| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -387,11 +387,15 @@ class ContextifyContext { | |
| Local<Object> proxy_global = PersistentToLocal(isolate, | ||
| ctx->proxy_global_); | ||
|
|
||
| bool in_sandbox = sandbox->GetRealNamedProperty(property).IsEmpty(); | ||
| bool in_sandbox = !(sandbox->GetRealNamedProperty(property).IsEmpty()); | ||
| bool in_proxy_global = | ||
| proxy_global->GetRealNamedProperty(property).IsEmpty(); | ||
| if (!in_sandbox || !in_proxy_global) { | ||
| args.GetReturnValue().Set(None); | ||
| !(proxy_global->GetRealNamedProperty(property).IsEmpty()); | ||
| if (in_sandbox || in_proxy_global) { | ||
| v8::PropertyAttribute attr = None; | ||
| if (in_sandbox) { | ||
| attr = sandbox->GetPropertyAttributes(property); | ||
| } | ||
|
Comment thread
Outdated
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityShouldn't we also add if (in_proxy_global) { attr = proxy_global->GetPropertyAttributes(property); } as the fallback?
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI tried that. It caused infinite recursion on proxy_global. I think @bnoordhuis has a patch into v8 to add a new api to support this. That's why this change is "partial fix"
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityGot it. Also given that per #855 I want to at least attempt to rip out proxy global entirely that might end up being unnecessary. Probably want to leave a TODO(smikes) in the source code though for later.
Sorry, something went wrong.
All reactions
|
||
| args.GetReturnValue().Set(attr); | ||
| } | ||
| } | ||
|
|
||
| Expand Down | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| var common = require('../common'); | ||
| var assert = require('assert'); | ||
|
|
||
| var vm = require('vm'); | ||
|
|
||
| var code = 'Object.getOwnPropertyDescriptor(this, "prop")'; | ||
|
|
||
| var x = {}; | ||
| Object.defineProperty(x, "prop", { | ||
| configurable: false, | ||
| enumerable: false, | ||
| writable: false, | ||
| value: "val" | ||
| }); | ||
| var o = vm.createContext(x); | ||
|
|
||
| var res = vm.runInContext(code, o, 'test'); | ||
|
|
||
| assert(res); | ||
| assert.equal(typeof res, 'object'); | ||
| assert.equal(res.value, "val"); | ||
| assert.equal(res.configurable, false, "should not be configurable"); | ||
| assert.equal(res.enumerable, false, "should not be enumerable"); | ||
| assert.equal(res.writable, false, "should not be writable"); |
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityWhy not HasRealNamedProperty ?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.