You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The note following the http.Server example in the vm documentation contains misleading language. Specifically, it mentions "the calling thread's context" when it has nothing to do with threading since code execution via vm happens on the same thread. The note makes it sound as if this is not the case.
I'm not sure what wording would describe this more accurately. "the parent context?" "the original context?"
Or, even better, taking the previous sentence into account:
Note: The require() in the above case shares the state with context it is
passed from. This may introduce risks when untrusted code is executed, e.g.
altering objects from the this context in unwanted ways.
It is as simple as possible and it's not misleading like my previous suggestion actually is, too, after some thinking about it. (The word "caller" sounds like "the caller of require" which is certainly not the case since it may be called from another sandbox).
Activity
aqrln commentedon Jan 9, 2017
@mscdex what about just "the caller's context"?
mscdex commentedon Jan 9, 2017
I'd probably be okay with that too.
aqrln commentedon Jan 9, 2017
Or, even better, taking the previous sentence into account:
It is as simple as possible and it's not misleading like my previous suggestion actually is, too, after some thinking about it. (The word "caller" sounds like "the caller of require" which is certainly not the case since it may be called from another sandbox).
mscdex commentedon Jan 9, 2017
Yep :-) (although s/state with context/state with the context/ and s/the this context/the context/)
aqrln commentedon Jan 9, 2017
Yeah, that's even better. I'll open a PR in a moment.
aqrln commentedon Jan 9, 2017
@mscdex and "the this" is a typo, I meant just "this" :)
doc: fix misleading language in vm docs
doc: fix misleading language in vm docs
doc: fix misleading language in vm docs
doc: fix misleading language in vm docs
doc: fix misleading language in vm docs
doc: fix misleading language in vm docs
doc: fix misleading language in vm docs