Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4825] Require / Exports file will crash if comments are at the end

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-11-10T14:18:10.000+0000
Affected Version/sRelease 1.7.2
Fix Version/sRelease 1.8.0.1
ComponentsiOS
Labelsn/a
ReporterRick Blalock
AssigneeBlain Hamon
Created2011-07-28T19:18:20.000+0000
Updated2011-12-07T15:57:17.000+0000

Description

If you leave a comment at the bottom of a file included using require(), a parse error happens.
exports.blah = function(value) {
   return value;
};

// Test
If you take //Test comment out - it works fine. Error:
[INFO] Application started
[DEBUG] reading stylesheet from: /Users/rickblalock/Library/Application Support/iPhone Simulator/4.3.2/Applications/F556303E-D2FA-4E79-BE62-58C03927B1A4/fishrules.app/stylesheet.plist
[INFO] fishrules/1.0 (1.8.0.67ca940)
[DEBUG] Analytics is enabled = YES
[DEBUG] loading: /Users/rickblalock/svn_repos/fishrules/Resources/app.js, resource: Users/rickblalock/svn_repos/fishrules/Resources/app_js
[DEBUG] loading: /Users/rickblalock/svn_repos/fishrules/Resources/modules/core.js, resource: Users/rickblalock/svn_repos/fishrules/Resources/modules/core_js
[ERROR] Script Error = {
    line = 8;
    message = "Parse error";
    name = SyntaxError;
    sourceId = 200399776;
}
2011-07-28 22:11:16.300 fishrules[30267:1ea07] *** Terminating app due to uncaught exception of class '__NSCFDictionary'
terminate called throwing an exception 

Comments

  1. Wilson Luu 2011-12-07

    Closing bug. Verified fix on KS using the following environment: OS: Mac OS X Lion Titanium Studio, build: 1.0.7.201112061404 SDK build: 1.8.0.1.v20111207151125 Device: iphone 4S Sprint (5.0.1)

JSON Source