[TIMOB-5355] Javascript parser crash on device when using commonJS modules
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-01-09T12:12:03.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.8.0.1 |
Components | iOS |
Labels | module_build, qe-testadded |
Reporter | Shannon Hicks |
Assignee | Blain Hamon |
Created | 2011-08-30T08:19:32.000+0000 |
Updated | 2012-01-09T12:12:03.000+0000 |
Description
Here's what the app.js file looks like:
var TextEditWindow = require('TextEditWindow').TextEditWindow;
Here's the TextEditWindow.js file:
exports.TextEditWindow = function() {
var win = Titanium.UI.createWindow();
return win;
};
exports.TextEditWindow.prototype.calculateBottom = function(orientation) {
var calculatedBottom = 10;
return calculateBottom;
}
Without a ";" at the end of TextEditWindow, it crashes on-device, but works in the Simulator. The crash said there was a parse error at line 3 (obviously nowhere near the problem), and doesn't specify which file. Either the parser should be a little less strict, or we should be able to get a more accurate error message.
Shannon Which device did you test this on, please? Thanks
I tried it on an iPhone 4 running the latest [REDACTED], and a 3G running 4.2.1
Hours recorded on 4825. Pull pending. https://github.com/appcelerator/titanium_mobile/pull/647
Bug fixed. Verified on: SDK: 1.8.0.1.v20111208104316 Studio: 1.0.7.201112080131 OS: OS X Lion Devices Tested: iPod 4.3.3
Added label qe-testadded.