Permalink
Browse files

fixed global error

  • Loading branch information...
1 parent 4a68730 commit 5ee341adfe227d10f332c13b4fdff7a8976b3a3f @coolaj86 committed Feb 27, 2011
Showing with 26 additions and 3 deletions.
  1. +19 −0 examples/require-test.js
  2. +6 −2 noop/index.js
  3. +1 −1 noop/package.json
View
@@ -0,0 +1,19 @@
+(function () {
+ "use strict";
+
+ require('noop');
+
+ noop();
+ throwop(null);
+ doop();
+
+ try {
+ throwop(new Error('error'));
+ } catch(e) {
+ console.log('Pass: thrown');
+ }
+
+ doop(function (word) {
+ console.log(word);
+ }, ['Pass: hi']);
+}());
View
@@ -1,8 +1,12 @@
-var provide = provide || function () {},
- global = this;
+var provide = provide || function () {};
+function getGlobal () {
+ return this;
+}
(function () {
"use strict";
+ var global = getGlobal();
+
function noop() {
// do nothing
}
View
@@ -6,5 +6,5 @@
"author" : "AJ ONeal <coolaj86@gmail.com>",
"contributors" : [],
"dependencies" : [],
- "version" : "0.2.1"
+ "version" : "0.2.2"
}

0 comments on commit 5ee341a

Please sign in to comment.