[inspector] Add regression test for hoisting and debug-evaluate
This CL adds a regression test for sloppy block function hoisting and debug-evaluate. This was fixed in the past but the test was missing. Fixed: chromium:1246897 Change-Id: I1d7dcbd4d95ef8e5a09f09615de017b65c3e7087 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4011039 Commit-Queue: Simon Zünd <szuend@chromium.org> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Cr-Commit-Position: refs/heads/main@{#84141}
This commit is contained in:
parent
97aebdc551
commit
b278b806f1
@ -0,0 +1,7 @@
|
||||
Test that sloppy function block hoisting works with debug-evaluate.
|
||||
Paused on debugger statement
|
||||
{
|
||||
result : {
|
||||
type : undefined
|
||||
}
|
||||
}
|
27
test/inspector/regress/regress-crbug-1246897.js
Normal file
27
test/inspector/regress/regress-crbug-1246897.js
Normal file
@ -0,0 +1,27 @@
|
||||
// Copyright 2022 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.
|
||||
|
||||
const {session, contextGroup, Protocol} = InspectorTest.start(
|
||||
'Test that sloppy function block hoisting works with debug-evaluate.');
|
||||
|
||||
(async () => {
|
||||
await Protocol.Debugger.enable();
|
||||
|
||||
Protocol.Runtime.evaluate({
|
||||
expression: `debugger`,
|
||||
replMode: true,
|
||||
});
|
||||
|
||||
const {params: { callFrames: [{callFrameId}]}} = await Protocol.Debugger.oncePaused();
|
||||
|
||||
InspectorTest.log('Paused on debugger statement');
|
||||
|
||||
const { result } = await Protocol.Debugger.evaluateOnCallFrame({
|
||||
expression: '{ function f() {f} }; f();',
|
||||
callFrameId,
|
||||
});
|
||||
InspectorTest.logMessage(result);
|
||||
|
||||
InspectorTest.completeTest();
|
||||
})();
|
Loading…
Reference in New Issue
Block a user