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 InspectorTest._commandsForLogging = new Set(); | 10 InspectorTest._commandsForLogging = new Set(); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 message.id = "<messageId>"; | 68 message.id = "<messageId>"; |
69 | 69 |
70 const nonStableFields = new Set(["objectId", "scriptId", "exceptionId", "times
tamp", | 70 const nonStableFields = new Set(["objectId", "scriptId", "exceptionId", "times
tamp", |
71 "executionContextId", "callFrameId", "breakpointId", "bindRemoteObjectFuncti
onId", "formatterObjectId" ]); | 71 "executionContextId", "callFrameId", "breakpointId", "bindRemoteObjectFuncti
onId", "formatterObjectId" ]); |
72 var objects = [ message ]; | 72 var objects = [ message ]; |
73 while (objects.length) { | 73 while (objects.length) { |
74 var object = objects.shift(); | 74 var object = objects.shift(); |
75 for (var key in object) { | 75 for (var key in object) { |
76 if (nonStableFields.has(key)) | 76 if (nonStableFields.has(key)) |
77 object[key] = `<${key}>`; | 77 object[key] = `<${key}>`; |
78 else if (typeof object[key] === "string" && object[key].match(/\d+:\d+:\d+
:debug/)) | |
79 object[key] = object[key].replace(/\d+/, '<scriptId>'); | |
80 else if (typeof object[key] === "object") | 78 else if (typeof object[key] === "object") |
81 objects.push(object[key]); | 79 objects.push(object[key]); |
82 } | 80 } |
83 } | 81 } |
84 | 82 |
85 InspectorTest.logObject(message); | 83 InspectorTest.logObject(message); |
86 return originalMessage; | 84 return originalMessage; |
87 } | 85 } |
88 | 86 |
89 InspectorTest.logObject = function(object, title) | 87 InspectorTest.logObject = function(object, title) |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 InspectorTest.log('WARNING: run test with --expose-inspector-scripts flag to
get more details.'); | 345 InspectorTest.log('WARNING: run test with --expose-inspector-scripts flag to
get more details.'); |
348 InspectorTest.log('WARNING: you can additionally comment rjsmin in xxd.py to
get unminified injected-script-source.js.'); | 346 InspectorTest.log('WARNING: you can additionally comment rjsmin in xxd.py to
get unminified injected-script-source.js.'); |
349 InspectorTest.setupScriptMap(); | 347 InspectorTest.setupScriptMap(); |
350 Protocol.Debugger.enable(); | 348 Protocol.Debugger.enable(); |
351 Protocol.Debugger.onPaused(message => { | 349 Protocol.Debugger.onPaused(message => { |
352 let callFrames = message.params.callFrames; | 350 let callFrames = message.params.callFrames; |
353 InspectorTest.logSourceLocations(callFrames.map(frame => frame.location)); | 351 InspectorTest.logSourceLocations(callFrames.map(frame => frame.location)); |
354 }) | 352 }) |
355 } | 353 } |
356 } | 354 } |
OLD | NEW |