Uh oh!
There was an error while loading. Please reload this page.
vm: support parsing a script in a specific context - #14888
Conversation
9a38ab7 to
1ea23acCompareTimothyGu
commented
Aug 17, 2017
/cc @nodejs/v8-inspector |
bnoordhuis
left a comment
There was a problem hiding this comment.
LGTM, I suppose, although it feels a bit like a workaround rather than a proper fix, and since it adds a public property, we might come to regret that later.
TimothyGu
commented
Aug 17, 2017
@bnoordhuis Would you be more satisfied had I made the option an "internal" one through unexposed symbols? |
bnoordhuis
commented
Aug 17, 2017
I think that would be best. We can always make it public later if a good use case presents itself. |
330e27b to
ce77785CompareTimothyGu
commented
Aug 18, 2017
@bnoordhuis Okay, done. |
There was a problem hiding this comment.
This seems like over-complicating it. You can create the symbol in InitContextify() or ContextifyScript::Init() and set it on target and then use it directly from the binding object, no need for a new file in lib/internal.
There was a problem hiding this comment.
... not sure what got into my head. Will do.
There was a problem hiding this comment.
You won't need this check if you do.
There was a problem hiding this comment.
FWIW, it's possible to condense this to:
Local<Value> value;
if (!obj->Get(context, key).ToLocal(&value)) return MaybeLocal<Context>();There was a problem hiding this comment.
This branch cannot realistically be taken, can it?
There was a problem hiding this comment.
Not sure, but the same check is in a couple of other places in the file so I wouldn't touch them in this PR.
TimothyGu
commented
Aug 23, 2017
@bnoordhuis would you mind taking another look? Thanks! |
TimothyGu
commented
Sep 1, 2017
I'll apply this early next week if I don't see any comments. |
There was a problem hiding this comment.
Could be shortened to Context::Scope scope(maybe_context.FromMaybe(env->context()));.
There was a problem hiding this comment.
Teeny tiny style nit but line continuations are indented by four spaces. (I don't know why the linter doesn't enforce that.)
PR-URL: nodejs#14888 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
f40774e to
d932e80CompareTimothyGu
commented
Sep 5, 2017
TimothyGu
commented
Sep 5, 2017
Landed in d932e80 with @bnoordhuis's comments fixed. |
PR-URL: nodejs/node#14888 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
PR-URL: #14888 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
PR-URL: #14888 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
MylesBorins
commented
Sep 11, 2017
It appears that this change is breaking I'm going to drop this from the 8.5.0 release and add semver-major for now |
TimothyGu
commented
Sep 11, 2017
@MylesBorins That sounds like a bug. I shall create a PR that fixes it. |
MylesBorins
commented
Sep 11, 2017
@TimothyGu to confirm, a bug with node or with browserify / watchify? |
TimothyGu
commented
Sep 11, 2017
@MylesBorins Node.js (this PR specifically). |
TimothyGu
commented
Sep 12, 2017
@MylesBorins Upon a second look, it seems to me that this bug is with Browserify -- or more specifically, an old and buggy version of Traceur's // Object.assign (19.1.3.1)functionassign(target,source){varprops=$getOwnPropertyNames(source);varp,length=props.length;for(p=0;p<length;p++){target[props[p]]=source[props[p]];}returntarget;}So, not a bug in Node.js after all... |
PR-URL: #14888 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
MylesBorins
commented
Oct 11, 2017
Marking this Semver-Major until it is not longer breaking the browserify test suite |
bug in traceur compiler polyfill in browserify is causing errors in 8.x and above. This needs to be fixed in browserify. Refs: nodejs/node#14888 (comment)
Differences are only observable through Inspector's
Debugger.scriptParsedevent (hence the Dev Tools frontend).Before when executing
vm.runInNewContext('debugger'):After:
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
vm