Skip to content

Commit 458ce4d

Browse files
authored
Simplify makeRetainedCompilerSettings. NFC (#25593)
In strict mode we don't define any of the legacy settings of the `ignore` mechanism here was doing nothing.
1 parent 11f5908 commit 458ce4d

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/parseTools.mjs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -805,24 +805,16 @@ function addAtPostRun(code) {
805805
}
806806

807807
function makeRetainedCompilerSettings() {
808-
const ignore = new Set();
809-
if (STRICT) {
810-
for (const setting of LEGACY_SETTINGS) {
811-
ignore.add(setting);
812-
}
813-
}
814-
815808
const ret = {};
816-
for (const x in global) {
817-
if (!ignore.has(x) && x[0] !== '_' && x == x.toUpperCase()) {
818-
const value = global[x];
809+
for (const [name, value] of Object.entries(global)) {
810+
if (name[0] !== '_' && name == name.toUpperCase()) {
819811
if (
820812
typeof value == 'number' ||
821813
typeof value == 'boolean' ||
822814
typeof value == 'string' ||
823-
Array.isArray(x)
815+
Array.isArray(name)
824816
) {
825-
ret[x] = value;
817+
ret[name] = value;
826818
}
827819
}
828820
}

0 commit comments

Comments
 (0)