Files
meteor/packages/coffeescript/coffeescript_tests.js
Andrew Wilcox 6873c91424 Allow CoffeeScript to set global vars when using "use strict".
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.
2013-04-15 10:52:01 -07:00

13 lines
483 B
JavaScript

Tinytest.add("coffeescript - presence", function(test) {
test.isTrue(Meteor.__COFFEESCRIPT_PRESENT);
});
Tinytest.add("literate coffeescript - presence", function(test) {
test.isTrue(Meteor.__LITCOFFEESCRIPT_PRESENT);
});
Tinytest.add("coffeescript - set global variable", function(test) {
test.equal(__COFFEESCRIPT_TEST_GLOBAL, 123);
});
Tinytest.add("coffeescript - set global variable with 'use strict'", function(test) {
test.equal(__COFFEESCRIPT_TEST_GLOBAL2, 456);
});