We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1277a6 commit f47c02cCopy full SHA for f47c02c
lib/execjs/support/json2.js
@@ -159,12 +159,13 @@
159
// Create a JSON object only if one does not already exist. We create the
160
// methods in a closure to avoid creating global variables.
161
162
-var JSON;
163
-if (!JSON) {
164
- JSON = {};
165
-}
+(function (global) {
+ if (!global.JSON) {
+ global.JSON = {};
+ }
166
+
167
+ var JSON = global.JSON;
168
-(function () {
169
"use strict";
170
171
function f(n) {
@@ -477,4 +478,4 @@ if (!JSON) {
477
478
throw new SyntaxError('JSON.parse');
479
};
480
}
-}());
481
+}(this));
0 commit comments