-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
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
contextify: share security token with debug ctx #748
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var common = require('../common'); | ||
var vm = require('vm'); | ||
var assert = require('assert'); | ||
|
||
var proto = vm.runInDebugContext('DebugCommandProcessor.prototype'); | ||
proto.prop = true; | ||
assert.equal(proto.prop, true); | ||
proto = vm.runInDebugContext('DebugCommandProcessor.prototype'); | ||
assert.equal(proto.prop, true); | ||
proto = vm.runInDebugContext('DebugCommandProcessor.prototype.prop = true;' + | ||
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. Should this line be setting to a different value than true? To be sure it actually does something? 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. I think this line could be removed. 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. My understanding of this line was it was testing that if you set it inside the vm, instead of outside, it still works. So it might be good to leave it in but use a different value. |
||
'DebugCommandProcessor.prototype'); | ||
assert.equal(proto.prop, true); |
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.
Could move this into the if, right?
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.
It will account for 0% of cases, because debug context is empty only when we are hard on memory (i.e. allocation failure).
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.
Actually, I meant to say that it'll be executed in 99.999% of cases anyway, not 0%.
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.
Yeah just thinking about keeping variables in their tightest scope. No big deal.