Opened 8 years ago

Closed 8 years ago

#15024 closed defect (worksforme)

AMD require: loading a generic script that ends with comment breaks loader

Reported by: Simon Speich Owned by: Rawld Gill
Priority: high Milestone: 1.7.3
Component: Loader Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

When loading a generic script in sync mode that ends with a comment, the loader genereates an error:

missing } after function body @ sourceURL=/class/js/TableSort.js

var dojoConfig = {
	async: false,
	baseUrl: 'http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/',
};
require(['/class/TableSort.js'], function() {
   var tbl = new TableSort();
   ...
});

// Begin file TableSort.js

   function TableSort(tbl) { ... }
   TableSort.prototype.init = function() {  ... };
   ...
   // comment at end of js file

// End of js file

@see also http://dojotoolkit.org/reference-guide/loader/amd.html#generic-script-injection

If I remove the comment or set async = true, the script loads without an error.

Change History (2)

comment:1 Changed 8 years ago by Rawld Gill

Milestone: tbd1.7.3
Priority: undecidedhigh
Status: newassigned

comment:2 Changed 8 years ago by Rawld Gill

Resolution: worksforme
Status: assignedclosed

I tried to duplicate...

trunk and the CND address shown FF and IE 8,9 comment with and without a newline

and I never saw a failure. If you still have this problem, please tell me your browser and attach files.

Note: See TracTickets for help on using tickets.