From e3effab86be91230bfbb0a446173ee6bea760591 Mon Sep 17 00:00:00 2001 From: David Majda Date: Tue, 28 Sep 2010 21:06:01 +0200 Subject: [PATCH] Behave correctly in Rhino context (fixes previous commit) --- src/peg.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/peg.js b/src/peg.js index 83ca2cf..c68b626 100644 --- a/src/peg.js +++ b/src/peg.js @@ -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);