Permalink
Browse files

fixed test, add global to the define signature

  • Loading branch information...
1 parent 579894a commit 57ba743c7ef78183f07886518b8e1965f9d2a0dd @substack committed Sep 19, 2012
Showing with 9 additions and 6 deletions.
  1. +2 −1 test/global.js
  2. +1 −1 wrappers/body.js
  3. +1 −1 wrappers/body_debug.js
  4. +1 −1 wrappers/entry.js
  5. +1 −1 wrappers/entry_debug.js
  6. +3 −1 wrappers/prelude.js
View
@@ -12,7 +12,8 @@ test('global', function (t) {
var c = {
t : t,
- window : { a : 555 }
+ a : 555,
};
+ c.window = c;
vm.runInNewContext(src, c);
});
View
@@ -1,2 +1,2 @@
-require.define($__filename,function(require,module,exports,__dirname,__filename,process){$body
+require.define($__filename,function(require,module,exports,__dirname,__filename,process,global){$body
});
@@ -1,2 +1,2 @@
-require.define($__filename,Function(['require','module','exports','__dirname','__filename','process'],$body
+require.define($__filename,Function(['require','module','exports','__dirname','__filename','process','global'],$body
));
View
@@ -1,3 +1,3 @@
-require.define($__filename,function(require,module,exports,__dirname,__filename,process){$body
+require.define($__filename,function(require,module,exports,__dirname,__filename,process,global){$body
});
require($__filename);
@@ -1,3 +1,3 @@
-require.define($__filename,Function(['require','module','exports','__dirname','__filename','process'],$body
+require.define($__filename,Function(['require','module','exports','__dirname','__filename','process','global'],$body
));
require($__filename);
View
@@ -139,6 +139,7 @@ require.alias = function (from, to) {
(function () {
var process = {};
+ var global = typeof window !== 'undefined' ? window : {};
var definedProcess = false;
require.define = function (filename, fn) {
@@ -185,7 +186,8 @@ require.alias = function (from, to) {
module_.exports,
dirname,
filename,
- process
+ process,
+ global
);
module_.loaded = true;
return module_.exports;

0 comments on commit 57ba743

Please sign in to comment.