Skip to content

Commit

Permalink
Behave correctly in Rhino context (fixes previous commit)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmajda committed Sep 28, 2010
1 parent 2120de3 commit e3effab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/peg.js
@@ -1,4 +1,4 @@
(function() {
(function(global) {

var undefined;

Expand Down Expand Up @@ -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.