diff options
Diffstat (limited to 'deps/v8/test/inspector/debugger/wasm-memory-names.js')
-rw-r--r-- | deps/v8/test/inspector/debugger/wasm-memory-names.js | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/deps/v8/test/inspector/debugger/wasm-memory-names.js b/deps/v8/test/inspector/debugger/wasm-memory-names.js index de622a2e95..160e6e83d3 100644 --- a/deps/v8/test/inspector/debugger/wasm-memory-names.js +++ b/deps/v8/test/inspector/debugger/wasm-memory-names.js @@ -50,24 +50,6 @@ function createInstance(moduleBytes) { new WebAssembly.Instance(module, {module_name: {imported_mem: memory}}); } -async function logMemoryName(msg, Protocol) { - let callFrames = msg.params.callFrames; - InspectorTest.log('Paused in debugger.'); - - let scopeChain = callFrames[0].scopeChain; - for (let scope of scopeChain) { - if (scope.type != 'module') continue; - let moduleObjectProps = (await Protocol.Runtime.getProperties({ - 'objectId': scope.object.objectId - })).result.result; - - for (let prop of moduleObjectProps) { - if (prop.name === 'instance' || prop.name === 'module') continue; - InspectorTest.log(`name: ${prop.name}`); - } - } -} - async function check(moduleBytes) { Protocol.Runtime.evaluate({ expression: ` @@ -91,8 +73,17 @@ async function check(moduleBytes) { InspectorTest.log('Running main.'); Protocol.Runtime.evaluate({expression: 'instance.exports.main()'}); - let msg = await Protocol.Debugger.oncePaused(); - await logMemoryName(msg, Protocol); + const {params: {callFrames: [{callFrameId}]}} = + await Protocol.Debugger.oncePaused(); + InspectorTest.log('Paused in debugger.'); + const {result: {result: {objectId}}} = + await Protocol.Debugger.evaluateOnCallFrame( + {callFrameId, expression: `memories`}); + const {result: {result: properties}} = + await Protocol.Runtime.getProperties({objectId}); + for (const {name} of properties) { + InspectorTest.log(`name: ${name}`); + } await Protocol.Debugger.resume(); InspectorTest.log('Finished.'); |