| 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 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 }); | 30 }); |
| 31 | 31 |
| 32 InspectorTest.log = print.bind(null); | 32 InspectorTest.log = print.bind(null); |
| 33 | 33 |
| 34 InspectorTest.logMessage = function(message) | 34 InspectorTest.logMessage = function(message) |
| 35 { | 35 { |
| 36 if (message.id) | 36 if (message.id) |
| 37 message.id = "<messageId>"; | 37 message.id = "<messageId>"; |
| 38 | 38 |
| 39 const nonStableFields = new Set(["objectId", "scriptId", "exceptionId", "times
tamp", "executionContextId"]); | 39 const nonStableFields = new Set(["objectId", "scriptId", "exceptionId", "times
tamp", "executionContextId", "callFrameId"]); |
| 40 var objects = [ message ]; | 40 var objects = [ message ]; |
| 41 while (objects.length) { | 41 while (objects.length) { |
| 42 var object = objects.shift(); | 42 var object = objects.shift(); |
| 43 for (var key in object) { | 43 for (var key in object) { |
| 44 if (nonStableFields.has(key)) | 44 if (nonStableFields.has(key)) |
| 45 object[key] = `<${key}>`; | 45 object[key] = `<${key}>`; |
| 46 else if (typeof object[key] === "object") | 46 else if (typeof object[key] === "object") |
| 47 objects.push(object[key]); | 47 objects.push(object[key]); |
| 48 } | 48 } |
| 49 } | 49 } |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 var eventName = messageObject["method"]; | 201 var eventName = messageObject["method"]; |
| 202 var eventHandler = InspectorTest._eventHandler[eventName]; | 202 var eventHandler = InspectorTest._eventHandler[eventName]; |
| 203 if (eventHandler) | 203 if (eventHandler) |
| 204 eventHandler(messageObject); | 204 eventHandler(messageObject); |
| 205 } | 205 } |
| 206 } catch (e) { | 206 } catch (e) { |
| 207 InspectorTest.log("Exception when dispatching message: " + e + "\n" + e.stac
k + "\n message = " + JSON.stringify(messageObject, null, 2)); | 207 InspectorTest.log("Exception when dispatching message: " + e + "\n" + e.stac
k + "\n message = " + JSON.stringify(messageObject, null, 2)); |
| 208 InspectorTest.completeTest(); | 208 InspectorTest.completeTest(); |
| 209 } | 209 } |
| 210 } | 210 } |
| OLD | NEW |