Permalink
Browse files

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

  • Loading branch information...
1 parent a74594d commit 3e5cea2a9eedb71aed72576f1518af1fe964e3f3 @jdalton jdalton committed Mar 10, 2013
Showing with 4 additions and 6 deletions.
  1. +1 −1 test/run-test.sh
  2. +1 −1 vendor/platform.js/README.md
  3. +2 −4 vendor/platform.js/platform.js
View
@@ -1,5 +1,5 @@
cd "$(dirname "$0")"
-for cmd in rhino narwhal ringo phantomjs node; do
+for cmd in rhino "rhino -require" narwhal ringo phantomjs node; do
echo ""
echo "Testing in $cmd..."
$cmd test.js
@@ -18,7 +18,7 @@ For a list of upcoming features, check out our [roadmap](https://github.com/best
## Support
-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.
+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.
## Installation and usage
@@ -992,16 +992,14 @@
});
}
// check for `exports` after `define` in case a build optimizer adds an `exports` object
- else if (freeExports) {
+ else if (freeExports && !freeExports.nodeType) {
// in Narwhal, Node.js, or RingoJS
forOwn(parse(), function(value, key) {
freeExports[key] = value;
});
}
// in a browser or Rhino
else {
- // use square bracket notation so Closure Compiler won't munge `platform`
- // http://code.google.com/closure/compiler/docs/api-tutorial3.html#export
- window['platform'] = parse();
+ window.platform = parse();
}
}(this));

0 comments on commit 3e5cea2

Please sign in to comment.