Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
Fix breakpoint format on large variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Loring committed May 16, 2016
1 parent 61846c5 commit 58006f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ StateResolver.prototype.resolveVariable_ = function(name, value) {
var maxLength = this.config_.capture.maxStringLength;
if (maxLength && maxLength < data.value.length) {
data.value = data.value.substring(0, maxLength) + '...';
data.status = MESSAGE_TABLE[STRING_LIMIT_MESSAGE_INDEX];
data.status = MESSAGE_TABLE[STRING_LIMIT_MESSAGE_INDEX].status;
}

} else if (value.isFunction()) {
Expand All @@ -371,7 +371,7 @@ StateResolver.prototype.resolveVariable_ = function(name, value) {
data.varTableIndex = this.getVariableIndex_(value);
var maxProps = this.config_.capture.maxProperties;
if (maxProps && maxProps < Object.keys(value.value()).length) {
data.status = MESSAGE_TABLE[OBJECT_LIMIT_MESSAGE_INDEX];
data.status = MESSAGE_TABLE[OBJECT_LIMIT_MESSAGE_INDEX].status;
}

} else {
Expand Down
1 change: 1 addition & 0 deletions test/e2e/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ function runTest() {
var promise = setBreakpoint(debuggee, {
id: 'breakpoint-1',
location: {path: 'test.js', line: 5},
expressions: ['process'], // Process for large variable
condition: 'n === 10'
});
// I don't know what I am doing. There is a better way to write the
Expand Down
4 changes: 2 additions & 2 deletions test/test-v8debugapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ describe('v8debugapi', function() {
var foo = bp.evaluatedExpressions[0];
var fooVal = bp.variableTable[foo.varTableIndex];
assert.equal(fooVal.members.length, 1);
assert(foo.status.status.description.format.indexOf(
assert(foo.status.description.format.indexOf(
'Only first') !== -1);
assert(!foo.status.isError);

Expand All @@ -589,7 +589,7 @@ describe('v8debugapi', function() {
var foo = bp.evaluatedExpressions[0];
var fooVal = bp.variableTable[foo.varTableIndex];
assert.equal(fooVal.members.length, 1);
assert(foo.status.status.description.format.indexOf(
assert(foo.status.description.format.indexOf(
'Only first') !== -1);
assert(!foo.status.isError);

Expand Down

0 comments on commit 58006f0

Please sign in to comment.