Skip to content

Commit 9dba017

Browse files
committed
Replace several push calls with a single one
1 parent 0b6d85a commit 9dba017

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

lib/getImportGlobalsSrc.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,22 @@ function getImportGlobalsSrc(ignore) {
1313
globalObj = typeof global === "undefined"? window: global;
1414

1515
ignore = ignore || [];
16-
// global itself can't be overridden because it's the only reference to our real global objects
17-
ignore.push("global");
18-
// ignore 'module', 'exports' and 'require' on the global scope, because otherwise our code would
19-
// shadow the module-internal variables
20-
// @see https://github.com/jhnns/rewire-webpack/pull/6
21-
ignore.push("module", "exports", "require");
22-
// strict mode doesn't allow to (re)define 'undefined', 'eval' & 'arguments'
23-
ignore.push("undefined", "eval", "arguments");
24-
// 'GLOBAL' and 'root' are deprecated in Node
25-
// (assigning them causes a DeprecationWarning)
26-
ignore.push("GLOBAL", "root");
27-
// 'NaN' and 'Infinity' are immutable
28-
// (doesn't throw an error if you set 'var NaN = ...', but doesn't work either)
29-
ignore.push("NaN", "Infinity");
16+
ignore.push(
17+
// global itself can't be overridden because it's the only reference to our real global objects
18+
"global",
19+
// ignore 'module', 'exports' and 'require' on the global scope, because otherwise our code would
20+
// shadow the module-internal variables
21+
// @see https://github.com/jhnns/rewire-webpack/pull/6
22+
"module", "exports", "require",
23+
// strict mode doesn't allow to (re)define 'undefined', 'eval' & 'arguments'
24+
"undefined", "eval", "arguments",
25+
// 'GLOBAL' and 'root' are deprecated in Node
26+
// (assigning them causes a DeprecationWarning)
27+
"GLOBAL", "root",
28+
// 'NaN' and 'Infinity' are immutable
29+
// (doesn't throw an error if you set 'var NaN = ...', but doesn't work either)
30+
"NaN", "Infinity",
31+
);
3032

3133
const globals = Object.getOwnPropertyNames(globalObj);
3234

0 commit comments

Comments
 (0)