repairFunctions: use globalEval binding to placate rollup
rollup is apparently allergic to the `(1, eval)(...)` trick to
avoid direct eval.  Binding eval to a different name is the only
way it supports usage without mangling.
MODIFY
package-lock.json
package-lock.json
{
"name": "realms-shim",
- "version": "1.1.0",
+ "version": "1.1.1-dev.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

MODIFY
package.json
package.json
{
"name": "realms-shim",
- "version": "1.1.0",
+ "version": "1.1.1-dev.0",
"description": "Spec-compliant shim for Realms TC39 Proposal",
"main": "dist/realms-shim.cjs.js",
"module": "dist/realms-shim.esm.js",

MODIFY
src/repair/functions.js
src/repair/functions.js
*/
// 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;
@@ -34,7 +35,7 @@ export function repairFunctions() {
let FunctionInstance;
try {
// eslint-disable-next-line no-new-func
- FunctionInstance = (0, eval)(declaration);
+ FunctionInstance = globalEval(declaration);
} catch (e) {
if (e instanceof SyntaxError) {
// Prevent failure on platforms where async and/or generators

MODIFY
src/unsafeRec.js
src/unsafeRec.js
@@ -94,7 +94,7 @@ const repairAccessorsShim = cleanupSource(
`"use strict"; (${repairAccessors})();`
);
const repairFunctionsShim = cleanupSource(
- `"use strict"; (${repairFunctions})();`
+ `"use strict"; const globalEval = eval; (${repairFunctions})();`
);
// Create a new unsafeRec from a brand new context, with new intrinsics and a

repairFunctions: use globalEval binding to placate rollup

rollup is apparently allergic to the `(1, eval)(...)` trick to
avoid direct eval.  Binding eval to a different name is the only
way it supports usage without mangling.