From 58006f0a00304fe4cccd7f3e1b17b06f0437e650 Mon Sep 17 00:00:00 2001 From: Matt Loring Date: Mon, 16 May 2016 10:51:29 -0700 Subject: [PATCH] Fix breakpoint format on large variables --- lib/state.js | 4 ++-- test/e2e/test.js | 1 + test/test-v8debugapi.js | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/state.js b/lib/state.js index ab17e547..6304b554 100644 --- a/lib/state.js +++ b/lib/state.js @@ -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()) { @@ -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 { diff --git a/test/e2e/test.js b/test/e2e/test.js index 5da8343f..b530e527 100644 --- a/test/e2e/test.js +++ b/test/e2e/test.js @@ -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 diff --git a/test/test-v8debugapi.js b/test/test-v8debugapi.js index 0967715d..e1716a7c 100644 --- a/test/test-v8debugapi.js +++ b/test/test-v8debugapi.js @@ -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); @@ -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);