@@ -1,4 +1,4 @@
1−const util = require('util');
1+const util = require("util");
22const repl = require("repl");
33const path = require("path");
44const fs = require("fs");
@@ -139,11 +139,6 @@ if (process.env.PRYBAR_CODE) {
139139 require: module.require.bind(module),
140140 __dirname: path.dirname(mainPath),
141141 __filename: mainPath,
142−
143− // These are deprecated properties and accessing them will trigger a warning.
144− // We add them manually for backward compat.
145− GLOBAL: global,
146− root: global,
147142 };
148143
149144 console.log(
@@ -152,13 +147,18 @@ if (process.env.PRYBAR_CODE) {
152147 const context = vm.createContext(sandbox);
153148
154149 // Adapted from https://bit.ly/2Fc4WjM
155− const globalBuiltins =
156− new Set(vm.runInNewContext('Object.getOwnPropertyNames(globalThis)'));
150+ const globalBuiltins = new Set(
151+ vm.runInContext("Object.getOwnPropertyNames(globalThis)", context)
152+ );
153+
157154 for (const name of Object.getOwnPropertyNames(global)) {
158155 // Only set properties that do not already exist as a global builtin.
159156 if (!globalBuiltins.has(name)) {
160− Object.defineProperty(context, name,
161− Object.getOwnPropertyDescriptor(global, name));
157+ Object.defineProperty(
158+ context,
159+ name,
160+ Object.getOwnPropertyDescriptor(global, name)
161+ );
162162 }
163163 }
164164 context.global = context;