This implies that all exports are package variables, which made underscore,
jquery, and htmljs (which explicitly assigned to fields on the global variable)
break. We now properly encapsulate these packages (except for window.jQuery,
which we let sneak out because bootstrap wants it). This means that packages
that want _ need to use underscore, and packages that want $ need to use jquery.
Also, you can't use _ in minimongo $where any more (matching mongod).
Note that this is only triggered when coffeescript manages to output invalid JS,
which should be unlikely.
This does remove the feature where lines and columns were suppressed for parse
errors in the output of template compilation. but (a) that shouldn't happen,
and (b) we'll fix this by implementing source maps for spacebars.
It's not used, it doesn't fully work yet, it's incompatible with the static
analysis, and it will make implementing CoffeeScript source maps significantly
more difficult.
@export is now an error in test slices.
This is preparation for ensuring that any slice with exports has at least
"Package.foo = {}"; without this commit, both the use and test slice would (with
that change) try to overwrite Package.foo.
Remove the attempt to allow @export in 'use strict' CoffeeScript files:
ECMAScript 'use strict' is fundamentally incompatible with our implementation of
exports, and it was probably a bug that this used to work at all.
You must declare your @exports using single-line ### comments:
### @export x ###
x = 5
This involves some ugly and not 100% correct low-level source hackery, making
some assumptions about the format that CoffeeScript generates.
The change I care about is that single-line ### comments get output as
single-line /**/ comments, which is what linker's @keyword parser is looking
for.
CoffeeScript doesn't allow you to assign to global variables using variable
assignment syntax (though you can assign properties to the global object), which
is the way to create package-level shared variables in Meteor. This commit
provides a CoffeeScript-specific to share variables between files in a package
without adding a redundant alternative for JavaScript files: simply assign
properties on the symbol `shared`.
Fixes#1050.
With the upgrade to CoffeeScript 1.6.2 the source file name and line
number of a parse error is no longer present in the `message` field of
the exception.
Ha. Turns out that `.call(this)` is needed after all when a
CoffeeScript file is using "use strict".
(http://es5.github.io/#x15.3.4.4)
Thanks to pipedreambomb on stackoverflow for the bug report and to
user1737909 for the documentation reference.