| Index: test/mjsunit/debug-backtrace.js
|
| diff --git a/test/mjsunit/debug-backtrace.js b/test/mjsunit/debug-backtrace.js
|
| index 3647913ac1fbed59ff54363b895c4ab32f7caf05..0888b987cf531d245d24f3dd1af893201c8ee12f 100644
|
| --- a/test/mjsunit/debug-backtrace.js
|
| +++ b/test/mjsunit/debug-backtrace.js
|
| @@ -30,7 +30,7 @@
|
| // testing of source line/column easier.
|
| function f(x, y) {
|
| a=1;
|
| -};
|
| +}
|
|
|
| var m = function() {
|
| new f(1);
|
| @@ -38,11 +38,11 @@ var m = function() {
|
|
|
| function g() {
|
| m();
|
| -};
|
| +}
|
|
|
|
|
| // Get the Debug object exposed from the debug context global object.
|
| -Debug = debug.Debug
|
| +Debug = debug.Debug;
|
|
|
| listenerCalled = false;
|
| exception = false;
|
| @@ -61,22 +61,22 @@ function ParsedResponse(json) {
|
|
|
| ParsedResponse.prototype.response = function() {
|
| return this.response_;
|
| -}
|
| +};
|
|
|
|
|
| ParsedResponse.prototype.body = function() {
|
| return this.response_.body;
|
| -}
|
| +};
|
|
|
|
|
| ParsedResponse.prototype.running = function() {
|
| return this.response_.running;
|
| -}
|
| +};
|
|
|
|
|
| ParsedResponse.prototype.lookup = function(handle) {
|
| return this.refs_[handle];
|
| -}
|
| +};
|
|
|
|
|
| function listener(event, exec_state, event_data, data) {
|
| @@ -99,7 +99,7 @@ function listener(event, exec_state, event_data, data) {
|
|
|
| // Get the backtrace.
|
| var json;
|
| - json = '{"seq":0,"type":"request","command":"backtrace"}'
|
| + json = '{"seq":0,"type":"request","command":"backtrace"}';
|
| var resp = dcp.processDebugJSONRequest(json);
|
| response = new ParsedResponse(resp);
|
| backtrace = response.body();
|
| @@ -123,7 +123,7 @@ function listener(event, exec_state, event_data, data) {
|
| assertFalse(response.running(), "expected not running");
|
|
|
| // Get backtrace with two frames.
|
| - json = '{"seq":0,"type":"request","command":"backtrace","arguments":{"fromFrame":1,"toFrame":3}}'
|
| + json = '{"seq":0,"type":"request","command":"backtrace","arguments":{"fromFrame":1,"toFrame":3}}';
|
| response = new ParsedResponse(dcp.processDebugJSONRequest(json));
|
| backtrace = response.body();
|
| assertEquals(1, backtrace.fromFrame);
|
| @@ -141,7 +141,7 @@ function listener(event, exec_state, event_data, data) {
|
| assertEquals("g", response.lookup(frames[1].func.ref).name);
|
|
|
| // Get backtrace with bottom two frames.
|
| - json = '{"seq":0,"type":"request","command":"backtrace","arguments":{"fromFrame":0,"toFrame":2, "bottom":true}}'
|
| + json = '{"seq":0,"type":"request","command":"backtrace","arguments":{"fromFrame":0,"toFrame":2, "bottom":true}}';
|
| response = new ParsedResponse(dcp.processDebugJSONRequest(json));
|
| backtrace = response.body();
|
| assertEquals(2, backtrace.fromFrame);
|
| @@ -158,7 +158,7 @@ function listener(event, exec_state, event_data, data) {
|
| assertEquals("", response.lookup(frames[1].func.ref).name);
|
|
|
| // Get the individual frames.
|
| - json = '{"seq":0,"type":"request","command":"frame"}'
|
| + json = '{"seq":0,"type":"request","command":"frame"}';
|
| response = new ParsedResponse(dcp.processDebugJSONRequest(json));
|
| frame = response.body();
|
| assertEquals(0, frame.index);
|
| @@ -168,12 +168,14 @@ function listener(event, exec_state, event_data, data) {
|
| assertEquals(3, frame.column);
|
| assertEquals(2, frame.arguments.length);
|
| assertEquals('x', frame.arguments[0].name);
|
| - assertEquals('number', response.lookup(frame.arguments[0].value.ref).type);
|
| + assertEquals('number',
|
| + response.lookup(frame.arguments[0].value.ref).type);
|
| assertEquals(1, response.lookup(frame.arguments[0].value.ref).value);
|
| assertEquals('y', frame.arguments[1].name);
|
| - assertEquals('undefined', response.lookup(frame.arguments[1].value.ref).type);
|
| + assertEquals('undefined',
|
| + response.lookup(frame.arguments[1].value.ref).type);
|
|
|
| - json = '{"seq":0,"type":"request","command":"frame","arguments":{"number":0}}'
|
| + json = '{"seq":0,"type":"request","command":"frame","arguments":{"number":0}}';
|
| response = new ParsedResponse(dcp.processDebugJSONRequest(json));
|
| frame = response.body();
|
| assertEquals(0, frame.index);
|
| @@ -182,12 +184,14 @@ function listener(event, exec_state, event_data, data) {
|
| assertEquals(3, frame.column);
|
| assertEquals(2, frame.arguments.length);
|
| assertEquals('x', frame.arguments[0].name);
|
| - assertEquals('number', response.lookup(frame.arguments[0].value.ref).type);
|
| + assertEquals('number',
|
| + response.lookup(frame.arguments[0].value.ref).type);
|
| assertEquals(1, response.lookup(frame.arguments[0].value.ref).value);
|
| assertEquals('y', frame.arguments[1].name);
|
| - assertEquals('undefined', response.lookup(frame.arguments[1].value.ref).type);
|
| + assertEquals('undefined',
|
| + response.lookup(frame.arguments[1].value.ref).type);
|
|
|
| - json = '{"seq":0,"type":"request","command":"frame","arguments":{"number":1}}'
|
| + json = '{"seq":0,"type":"request","command":"frame","arguments":{"number":1}}';
|
| response = new ParsedResponse(dcp.processDebugJSONRequest(json));
|
| frame = response.body();
|
| assertEquals(1, frame.index);
|
| @@ -198,15 +202,16 @@ function listener(event, exec_state, event_data, data) {
|
| assertEquals(6, frame.column);
|
| assertEquals(0, frame.arguments.length);
|
|
|
| - json = '{"seq":0,"type":"request","command":"frame","arguments":{"number":3}}'
|
| + json = '{"seq":0,"type":"request","command":"frame","arguments":{"number":3}}';
|
| response = new ParsedResponse(dcp.processDebugJSONRequest(json));
|
| frame = response.body();
|
| assertEquals(3, frame.index);
|
| assertEquals("", response.lookup(frame.func.ref).name);
|
|
|
| - // Source slices for the individual frames (they all refer to this script).
|
| + // Source slices for the individual frames (they all refer
|
| + // to this script).
|
| json = '{"seq":0,"type":"request","command":"source",' +
|
| - '"arguments":{"frame":0,"fromLine":30,"toLine":32}}'
|
| + '"arguments":{"frame":0,"fromLine":30,"toLine":32}}';
|
| response = new ParsedResponse(dcp.processDebugJSONRequest(json));
|
| source = response.body();
|
| assertEquals("function f(x, y) {", source.source.substring(0, 18));
|
| @@ -214,7 +219,7 @@ function listener(event, exec_state, event_data, data) {
|
| assertEquals(32, source.toLine);
|
|
|
| json = '{"seq":0,"type":"request","command":"source",' +
|
| - '"arguments":{"frame":1,"fromLine":31,"toLine":32}}'
|
| + '"arguments":{"frame":1,"fromLine":31,"toLine":32}}';
|
| response = new ParsedResponse(dcp.processDebugJSONRequest(json));
|
| source = response.body();
|
| assertEquals(" a=1;", source.source.substring(0, 6));
|
| @@ -222,7 +227,7 @@ function listener(event, exec_state, event_data, data) {
|
| assertEquals(32, source.toLine);
|
|
|
| json = '{"seq":0,"type":"request","command":"source",' +
|
| - '"arguments":{"frame":2,"fromLine":35,"toLine":36}}'
|
| + '"arguments":{"frame":2,"fromLine":35,"toLine":36}}';
|
| response = new ParsedResponse(dcp.processDebugJSONRequest(json));
|
| source = response.body();
|
| assertEquals(" new f(1);", source.source.substring(0, 11));
|
| @@ -231,12 +236,12 @@ function listener(event, exec_state, event_data, data) {
|
|
|
| // Test line interval way beyond this script will result in an error.
|
| json = '{"seq":0,"type":"request","command":"source",' +
|
| - '"arguments":{"frame":0,"fromLine":10000,"toLine":20000}}'
|
| + '"arguments":{"frame":0,"fromLine":10000,"toLine":20000}}';
|
| response = new ParsedResponse(dcp.processDebugJSONRequest(json));
|
| assertFalse(response.response().success);
|
|
|
| // Test without arguments.
|
| - json = '{"seq":0,"type":"request","command":"source"}'
|
| + json = '{"seq":0,"type":"request","command":"source"}';
|
| response = new ParsedResponse(dcp.processDebugJSONRequest(json));
|
| source = response.body();
|
| assertEquals(Debug.findScript(f).source, source.source);
|
| @@ -244,7 +249,7 @@ function listener(event, exec_state, event_data, data) {
|
| // New copy of debug command processor in running state.
|
| dcp = exec_state.debugCommandProcessor(true);
|
| // Get the backtrace.
|
| - json = '{"seq":0,"type":"request","command":"backtrace"}'
|
| + json = '{"seq":0,"type":"request","command":"backtrace"}';
|
| resp = dcp.processDebugJSONRequest(json);
|
| response = new ParsedResponse(resp);
|
| // It might be argueable, but we expect response to have body when
|
| @@ -255,9 +260,9 @@ function listener(event, exec_state, event_data, data) {
|
| listenerCalled = true;
|
| }
|
| } catch (e) {
|
| - exception = e
|
| - };
|
| -};
|
| + exception = e;
|
| + }
|
| +}
|
|
|
| // Add the debug event listener.
|
| Debug.setListener(listener);
|
|
|