OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 InspectorTest = {}; | 5 InspectorTest = {}; |
6 InspectorTest._dispatchTable = new Map(); | 6 InspectorTest._dispatchTable = new Map(); |
7 InspectorTest._requestId = 0; | 7 InspectorTest._requestId = 0; |
8 InspectorTest._dumpInspectorProtocolMessages = false; | 8 InspectorTest._dumpInspectorProtocolMessages = false; |
9 InspectorTest._eventHandler = {}; | 9 InspectorTest._eventHandler = {}; |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 const nonStableFields = new Set(["objectId", "scriptId", "exceptionId", "times
tamp", "executionContextId", "callFrameId", "breakpointId"]); | 41 const nonStableFields = new Set(["objectId", "scriptId", "exceptionId", "times
tamp", "executionContextId", "callFrameId", "breakpointId"]); |
42 var objects = [ message ]; | 42 var objects = [ message ]; |
43 while (objects.length) { | 43 while (objects.length) { |
44 var object = objects.shift(); | 44 var object = objects.shift(); |
45 for (var key in object) { | 45 for (var key in object) { |
46 if (nonStableFields.has(key)) | 46 if (nonStableFields.has(key)) |
47 object[key] = `<${key}>`; | 47 object[key] = `<${key}>`; |
48 else if (typeof object[key] === "object") | 48 else if (typeof object[key] === "object") |
49 objects.push(object[key]); | 49 objects.push(object[key]); |
| 50 else if (typeof object[key] === "string") |
| 51 object[key] = object[key].replace(/([0-9]+):([0-9]+):([0-9]+)(\:debug)?/
, '<scriptId>:$2:$3$4'); |
50 } | 52 } |
51 } | 53 } |
52 | 54 |
53 InspectorTest.logObject(message); | 55 InspectorTest.logObject(message); |
54 return originalMessage; | 56 return originalMessage; |
55 } | 57 } |
56 | 58 |
57 InspectorTest.logObject = function(object, title) | 59 InspectorTest.logObject = function(object, title) |
58 { | 60 { |
59 var lines = []; | 61 var lines = []; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 if (eventName === "Debugger.scriptParsed" && messageObject.params.url ===
"wait-pending-tasks.js") | 238 if (eventName === "Debugger.scriptParsed" && messageObject.params.url ===
"wait-pending-tasks.js") |
237 return; | 239 return; |
238 if (eventHandler) | 240 if (eventHandler) |
239 eventHandler(messageObject); | 241 eventHandler(messageObject); |
240 } | 242 } |
241 } catch (e) { | 243 } catch (e) { |
242 InspectorTest.log("Exception when dispatching message: " + e + "\n" + e.stac
k + "\n message = " + JSON.stringify(messageObject, null, 2)); | 244 InspectorTest.log("Exception when dispatching message: " + e + "\n" + e.stac
k + "\n message = " + JSON.stringify(messageObject, null, 2)); |
243 InspectorTest.completeTest(); | 245 InspectorTest.completeTest(); |
244 } | 246 } |
245 } | 247 } |
OLD | NEW |