We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dac2cc6 commit 4d0e056Copy full SHA for 4d0e056
src/pkg/sandbox/sandbox.ts
@@ -42,7 +42,7 @@ for (const key in descs) {
42
export function buildThis(global: any, context: any) {
43
let special = Object.assign({}, writables);
44
// 后台脚本要不要考虑不能使用eval?
45
- let _this: any = { eval: global.eval };
+ let _this: any = {};
46
let proxy: any = new Proxy(context, {
47
defineProperty(_, name, desc) {
48
return Object.defineProperty(context, name, desc);
@@ -113,5 +113,6 @@ export function buildThis(global: any, context: any) {
113
return ret;
114
}
115
});
116
+ _this.eval = global.eval.bind(proxy);
117
return proxy;
118
0 commit comments