| // Copyright 2018 the V8 project authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| let {session, contextGroup, Protocol} = |
| InspectorTest.start('Check [[FunctionLocation]] internal property'); |
| session.setupScriptMap(); |
| Protocol.Debugger.enable(); |
| await session.logSourceLocation(await functionLocation('a'), true); |
| await session.logSourceLocation(await functionLocation('b'), true); |
| await session.logSourceLocation(await functionLocation('c'), true); |
| await session.logSourceLocation(await functionLocation('d'), true); |
| InspectorTest.completeTest(); |
| async function functionLocation(name) { |
| const {result:{result}} = await Protocol.Runtime.evaluate({expression: name}); |
| const {result:{internalProperties}} = await Protocol.Runtime.getProperties({ |
| objectId: result.objectId |
| const {value:{value}} = internalProperties.find( |
| prop => prop.name === '[[FunctionLocation]]'); |