Skip to content

Commit

Permalink
fix(vm): more correct proxy for sandboxed object
Browse files Browse the repository at this point in the history
  • Loading branch information
Igmat committed Feb 28, 2018
1 parent f8ddd23 commit b31a8de
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/baset-vm/dist/contextify.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ const Decontextify = {
if (key === 'isVMProxy') return true;
if (mock && host.Object.prototype.hasOwnProperty.call(mock, key)) return mock[key];
if (key === 'constructor') return host.Object;
if (key === '__proto__') return host.Object.prototype;
if (key === '__proto__') return host.Object.prototype;

// TODO: check if it breaks contextifying
const config = host.Object.getOwnPropertyDescriptor(object, key);
if (config && config.configurable === false && config.writable === false) {
return object[key];
}

try {
return Decontextify.value(object[key], null, deepTraps, flags);
Expand Down

0 comments on commit b31a8de

Please sign in to comment.