v8/test/inspector/debugger/call-frame-url.js
Alexey Kozyatinskiy d63594b684 [inspector] added url to Debugger.CallFrame
Runtime.CallFrame has url already. It allows to show stack traces on pause
without tacking all parsed scripts.

R=alph@chromium.org,pfeldman@chromium.org

Bug: chromium:762982
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ic4f096ade1cb6c9de42fec77280dcc3007c6a5cf
Reviewed-on: https://chromium-review.googlesource.com/648068
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47895}
2017-09-07 16:39:31 +00:00

21 lines
756 B
JavaScript

// Copyright 2017 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('Tests url in Debugger.CallFrame.');
contextGroup.addScript(`
eval('function foo1() { debugger; }');
eval('function foo2() { foo1() } //# sourceURL=source-url.js');
function foo3() { foo2(); }
`, 0, 0, 'test.js');
(async function test() {
Protocol.Debugger.enable();
Protocol.Runtime.evaluate({expression: 'foo3()//# sourceURL=expr.js'});
let {params:{callFrames}} = await Protocol.Debugger.oncePaused();
InspectorTest.logMessage(callFrames.map(frame => ({url: frame.url})));
InspectorTest.completeTest();
})();