From a185aa752281726368941783bd1f9c6a4eb47661 Mon Sep 17 00:00:00 2001 From: JF Paradis Date: Mon, 30 Sep 2019 20:21:06 -0700 Subject: [PATCH] Prevent mangling of variables. https://github.com/Agoric/realms-shim/issues/60 Use minimized UMD in demo. --- examples/simple.html | 2 +- src/repair/functions.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/simple.html b/examples/simple.html index dc4a6d7..7c63e59 100644 --- a/examples/simple.html +++ b/examples/simple.html @@ -1,6 +1,6 @@
- +

Realm Shim

diff --git a/src/repair/functions.js b/src/repair/functions.js index 9044a03..4a75982 100644 --- a/src/repair/functions.js +++ b/src/repair/functions.js @@ -18,7 +18,6 @@ */ // todo: this file should be moved out to a separate repo and npm module. -const globalEval = eval; export function repairFunctions() { const { defineProperties, getPrototypeOf, setPrototypeOf } = Object; @@ -35,7 +34,7 @@ export function repairFunctions() { let FunctionInstance; try { // eslint-disable-next-line no-new-func - FunctionInstance = globalEval(declaration); + FunctionInstance = (0, eval)(declaration); } catch (e) { if (e instanceof SyntaxError) { // Prevent failure on platforms where async and/or generators