Permalink
Browse files

Behave correctly in Rhino context (fixes previous commit)

  • Loading branch information...
1 parent 2120de3 commit e3effab86be91230bfbb0a446173ee6bea760591 @dmajda dmajda committed Sep 28, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/peg.js
View
@@ -1,4 +1,4 @@
-(function() {
+(function(global) {
var undefined;
@@ -34,8 +34,8 @@ PEG.GrammarError.prototype = Error.prototype;
if (typeof exports !== "undefined") { // Looks like we're in CommonJS environment.
extend(exports, PEG);
-} else { // Okay, assume this is a browser.
- window.PEG = PEG;
+} else { // Okay, assume this is a browser/Rhino.
+ global.PEG = PEG;
}
-})();
+})(this);

0 comments on commit e3effab

Please sign in to comment.