Permalink
Browse files

Fix the require statements so it doesn't mess AMD scanners

  • Loading branch information...
1 parent 3420ba7 commit ef0aaea6659be2b0bc22aaa0bc52d640a37ff6f4 @kriszyp committed Feb 16, 2012
Showing with 4 additions and 5 deletions.
  1. +4 −5 process.js
View
@@ -1,5 +1,5 @@
-({define:typeof define!="undefined"?define:function(factory){factory(require,exports)}}).
-define(function(require,exports){
+({define:typeof define!="undefined"?define:function(deps, factory){factory(require,exports)}}).
+define([], function(req,exports){
if(typeof console !== "undefined"){
exports.print = function(){
console.log.apply(console, arguments);
@@ -8,14 +8,13 @@ if(typeof console !== "undefined"){
if(typeof process !== "undefined"){
exports.args = process.argv;
exports.env = process.env;
- var sys = require("" + "sys");
exports.print = console.log;
exports.dir = console.dir;
}
else if(typeof navigator === "undefined"){
try{
- exports.args = require("" + "system").args;
- exports.env = require("" + "system").env;
+ exports.args = req("" + "system").args;
+ exports.env = req("" + "system").env;
}catch(e){
// in raw rhino, we don't even have system
}

0 comments on commit ef0aaea

Please sign in to comment.