From 4ec213b0aa1aeb1b3220ef4b65d8b94f54ddc7b9 Mon Sep 17 00:00:00 2001 From: Garcia Date: Fri, 2 Sep 2022 08:55:44 -0700 Subject: fix(ext/timers): create primordial `eval` (#15110) --- core/00_primordials.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/00_primordials.js') diff --git a/core/00_primordials.js b/core/00_primordials.js index 4ca7ce073..843eb8b29 100644 --- a/core/00_primordials.js +++ b/core/00_primordials.js @@ -468,6 +468,11 @@ queueMicrotask = value; }; + // Renaming from `eval` is necessary because otherwise it would perform direct + // evaluation, allowing user-land access to local variables. + // This is because the identifier `eval` is somewhat treated as a keyword + primordials.indirectEval = eval; + ObjectSetPrototypeOf(primordials, null); ObjectFreeze(primordials); -- cgit v1.2.3