Skip to content

Commit 6775152

Browse files
Merge pull request #17 from lionel-rowe/indirect-eval
Switch direct eval to indirect eval to fix esbuild warnings
2 parents 2968cd9 + 22c7e7e commit 6775152

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,14 +488,14 @@ function processBuiltString (method, str, buildState) {
488488
}
489489
}
490490

491-
const final = `(state, values, methods, gen, notTraversed, Override, asyncIterators) => ${buildState.asyncDetected ? 'async' : ''} (context ${
491+
const final = `(state, values, methods, gen, notTraversed, Override, asyncIterators, r, rAsync) => ${buildState.asyncDetected ? 'async' : ''} (context ${
492492
buildState.yieldUsed ? ', resumable = {}' : ''
493493
}) => { ${copyStateCall} const result = ${str}; return result }`
494494

495495
// console.log(str)
496496
// console.log(final)
497497
// eslint-disable-next-line no-eval
498-
return declareSync(eval(final)(state, values, methods, gen, notTraversed, Override, asyncIterators), !buildState.asyncDetected)
498+
return declareSync(globalThis.eval(final)(state, values, methods, gen, notTraversed, Override, asyncIterators, r, rAsync), !buildState.asyncDetected)
499499
}
500500

501501
export { build }

utilities/chainingSupported.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const getIsOptionalChainingSupported = () => {
99
// eslint-disable-next-line no-unused-vars
1010
const test = {}
1111
// eslint-disable-next-line no-eval
12-
const isUndefined = eval('(test) => test?.foo?.bar')(test)
12+
const isUndefined = globalThis.eval('(test) => test?.foo?.bar')(test)
1313
return isUndefined === undefined
1414
} catch {
1515
return false

0 commit comments

Comments
 (0)