Skip to content

Commit

Permalink
Fix issue 48
Browse files Browse the repository at this point in the history
Breakout via RangeError: Maximum call stack size exceeded
Remove handler singleton.
  • Loading branch information
jfparadis committed Sep 14, 2019
1 parent 01b8558 commit 0871c24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/evaluators.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export function createSafeEvaluatorFactory(
) {
const { unsafeFunction } = unsafeRec;

const scopeHandler = createScopeHandler(unsafeRec, safeGlobal, sloppyGlobals);
const constants = getOptimizableGlobals(safeGlobal);
const scopedEvaluatorFactory = createScopedEvaluatorFactory(
unsafeRec,
Expand Down Expand Up @@ -112,6 +111,8 @@ export function createSafeEvaluatorFactory(
safeGlobal,
getOwnPropertyDescriptors(rewriterState.endowments)
);

const scopeHandler = createScopeHandler(unsafeRec, safeGlobal, sloppyGlobals);
const scopeProxy = new Proxy(scopeTarget, scopeHandler);
const scopedEvaluator = apply(scopedEvaluatorFactory, safeGlobal, [
scopeProxy
Expand Down

0 comments on commit 0871c24

Please sign in to comment.