Skip to content

Commit 1f28959

Browse files
committed
Trivial tweaks that happen to allow for Node 8, Node 10 Compat.
Node 6 requires Babel to deal with async, but works fine. If it was more than these trivial tweaks, I probably would not bother, but since I got an itch and was curious, I figured it was worth making minor adjustments. Odds are, no one will benefit from this.
1 parent d8d40cf commit 1f28959

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ function processBuiltString (method, str, buildState) {
367367
// console.log(str)
368368
// console.log(final)
369369
// eslint-disable-next-line no-eval
370-
return declareSync(globalThis.eval(final)(state, values, methods, gen, notTraversed, Override, asyncIterators), !buildState.asyncDetected)
370+
return declareSync((typeof globalThis !== 'undefined' ? globalThis : global).eval(final)(state, values, methods, gen, notTraversed, Override, asyncIterators), !buildState.asyncDetected)
371371
}
372372

373373
export { build }

utilities/chainingSupported.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ const getIsOptionalChainingSupported = () => {
99
// eslint-disable-next-line no-unused-vars
1010
const test = {}
1111
// eslint-disable-next-line no-eval
12-
const isUndefined = globalThis.eval('(test) => test?.foo?.bar')(test)
12+
const isUndefined = (typeof globalThis !== 'undefined' ? globalThis : global).eval('(test) => test?.foo?.bar')(test)
1313
return isUndefined === undefined
14-
} catch {
14+
} catch (err) {
1515
return false
1616
}
1717
}

0 commit comments

Comments
 (0)