forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proof of Concept: intercept defineProperty()
A lot of contextify issues seem to be related to the fact that we cannot intercept defineProperty(), see nodejs#6283. Here is a proof of concept implementation that gets rid of the CopyProperties() hack in contextify. For simplicty, only getters from the descriptors are copied. Also, function declarations are not intercepted, but that should be easy to do. It'll be a while until I get this cleanly into V8, but I think once the V8 API allows for intercepting defineProperty() and function declarations, a lot of contextify issues can be solved.
- Loading branch information
Showing
10 changed files
with
113 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* eslint-disable no-debugger */ | ||
'use strict'; | ||
require('../common'); | ||
var assert = require('assert'); | ||
var vm = require('vm'); | ||
|
||
// https://github.com/nodejs/node/issues/6287 | ||
|
||
const sbox = { }; | ||
vm.createContext(sbox); | ||
vm.runInContext('this.x = "w00t";delete this.x;', sbox); | ||
|
||
assert.equal(sbox.x, undefined); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters