require() loads js in strict mode

Main advantage: variables won't accidentally
leak into the global scope.

$ cat gg.js
bad = true

https://img.skitch.com/20110909-kry3pm4ask5qhj5rg43yb37tci.png
This commit is contained in:
Chris Wanstrath
2011-09-08 18:00:53 -07:00
parent 1cc3a61172
commit c69ac0f49a

View File

@@ -45,6 +45,7 @@ exts =
if not /define\(/.test code
code = """
define(function(require, exports, module) {
'use strict';
#{code};
});
"""