Skip to content
This repository
Browse code

Update vendor/platform.js and add test for `rhino -require`.

  • Loading branch information...
commit 3e5cea2a9eedb71aed72576f1518af1fe964e3f3 1 parent a74594d
John-David Dalton authored March 09, 2013
2  test/run-test.sh
... ...
@@ -1,5 +1,5 @@
1 1
 cd "$(dirname "$0")"
2  
-for cmd in rhino narwhal ringo phantomjs node; do
  2
+for cmd in rhino "rhino -require" narwhal ringo phantomjs node; do
3 3
 	echo ""
4 4
 	echo "Testing in $cmd..."
5 5
 	$cmd test.js
2  vendor/platform.js/README.md
Source Rendered
@@ -18,7 +18,7 @@ For a list of upcoming features, check out our [roadmap](https://github.com/best
18 18
 
19 19
 ## Support
20 20
 
21  
-Platform.js has been tested in at least Adobe AIR 3.1, Chrome 5~25, Firefox 1~19, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.22, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5.
  21
+Platform.js has been tested in at least Chrome 5~25, Firefox 1~19, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.22, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5.
22 22
 
23 23
 ## Installation and usage
24 24
 
6  vendor/platform.js/platform.js
@@ -992,7 +992,7 @@
992 992
     });
993 993
   }
994 994
   // check for `exports` after `define` in case a build optimizer adds an `exports` object
995  
-  else if (freeExports) {
  995
+  else if (freeExports && !freeExports.nodeType) {
996 996
     // in Narwhal, Node.js, or RingoJS
997 997
     forOwn(parse(), function(value, key) {
998 998
       freeExports[key] = value;
@@ -1000,8 +1000,6 @@
1000 1000
   }
1001 1001
   // in a browser or Rhino
1002 1002
   else {
1003  
-    // use square bracket notation so Closure Compiler won't munge `platform`
1004  
-    // http://code.google.com/closure/compiler/docs/api-tutorial3.html#export
1005  
-    window['platform'] = parse();
  1003
+    window.platform = parse();
1006 1004
   }
1007 1005
 }(this));

0 notes on commit 3e5cea2

Please sign in to comment.
Something went wrong with that request. Please try again.