Add allowExpressions option#244
Add allowExpressions option#244matthewloring merged 1 commit intogoogleapis:masterfrom matthewloring:opt
Conversation
ofrobots
left a comment
There was a problem hiding this comment.
The README examples also need to be modified to always suggest that users set allowExpressions to true.
test/test-v8debugapi.js
Outdated
| it('should capture without values when `allowExpressions=false`', function(done) { | ||
| // clone a clean breakpointInFoo | ||
| var bp = {id: breakpointInFoo.id, location: breakpointInFoo.location}; | ||
| config.allowExpressions = false; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| debuglet.start(); | ||
| }); | ||
|
|
||
| it('should reject breakpoints with conditions when allowExpressions=false', |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| debuglet.start(); | ||
| }); | ||
|
|
||
| it('should reject breakpoints with expressions when allowExpressions=false', |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/agent/state.js
Outdated
| varTableIndex: EXPRESSIONS_DISALLOWED_INDEX | ||
| }); | ||
| locals.push({ | ||
| name: 'locals_not_available', |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
ofrobots
left a comment
There was a problem hiding this comment.
LGTM w/ nit + question?
src/agent/config.js
Outdated
| description: null, | ||
|
|
||
| /** | ||
| * @property {boolean} Whether or not it is safe to evaluate expressions. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| var args = []; | ||
| var locals = []; | ||
| // Locals and arguments are safe to collect even when `config.allowExpressions=false` | ||
| // since we properly avoid inspecting interceptors and getters by default. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
No description provided.