Chromium Code Reviews| Index: test/mjsunit/debug-backtrace.js |
| diff --git a/test/mjsunit/debug-backtrace.js b/test/mjsunit/debug-backtrace.js |
| index 3647913ac1fbed59ff54363b895c4ab32f7caf05..9e096a252683cccc02a230598fec679e78f3c29c 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}}'; |
|
Rico
2011/12/08 10:24:37
long line
Lasse Reichstein
2011/12/08 12:33:18
Single string JSON literal. I don't want to start
|
| 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}}'; |
|
Rico
2011/12/08 10:24:37
long line
Lasse Reichstein
2011/12/08 12:33:18
ditto.
|
| 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); |
| @@ -173,7 +173,7 @@ function listener(event, exec_state, event_data, data) { |
| assertEquals('y', frame.arguments[1].name); |
| 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}}'; |
|
Rico
2011/12/08 10:24:37
long line
Lasse Reichstein
2011/12/08 12:33:18
ditto.
|
| response = new ParsedResponse(dcp.processDebugJSONRequest(json)); |
| frame = response.body(); |
| assertEquals(0, frame.index); |
| @@ -187,7 +187,7 @@ function listener(event, exec_state, event_data, data) { |
| assertEquals('y', frame.arguments[1].name); |
| 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}}'; |
|
Rico
2011/12/08 10:24:37
long line
Lasse Reichstein
2011/12/08 12:33:18
ditto
|
| response = new ParsedResponse(dcp.processDebugJSONRequest(json)); |
| frame = response.body(); |
| assertEquals(1, frame.index); |
| @@ -198,15 +198,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}}'; |
|
Rico
2011/12/08 10:24:37
long line
Lasse Reichstein
2011/12/08 12:33:18
ditto
|
| 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 +215,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 +223,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 +232,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 +245,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 +256,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); |