| Index: test/cctest/compiler/test-run-bytecode-graph-builder.cc
|
| diff --git a/test/cctest/compiler/test-run-bytecode-graph-builder.cc b/test/cctest/compiler/test-run-bytecode-graph-builder.cc
|
| index aa640de08a678cdae96d71d6bab5b132765de1a5..c15a4684c1da70c305450af2900176ccb9a8683f 100644
|
| --- a/test/cctest/compiler/test-run-bytecode-graph-builder.cc
|
| +++ b/test/cctest/compiler/test-run-bytecode-graph-builder.cc
|
| @@ -2669,6 +2669,37 @@ TEST(BytecodeGraphBuilderWithStatement) {
|
| }
|
| }
|
|
|
| +TEST(BytecodeGraphBuilderDebuggerStatement) {
|
| + FLAG_expose_debug_as = "debug";
|
| + HandleAndZoneScope scope;
|
| + Isolate* isolate = scope.main_isolate();
|
| + Zone* zone = scope.main_zone();
|
| +
|
| + ExpectedSnippet<0> snippet = {
|
| + "var Debug = debug.Debug;"
|
| + "var count = 0;"
|
| + "function f() {"
|
| + " debugger;"
|
| + "}"
|
| + "function listener(event) {"
|
| + " if (event == Debug.DebugEvent.Break) count++;"
|
| + "}"
|
| + "Debug.setListener(listener);"
|
| + "f();"
|
| + "Debug.setListener(null);"
|
| + "return count;",
|
| + {handle(Smi::FromInt(1), isolate)}};
|
| +
|
| + ScopedVector<char> script(1024);
|
| + SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
|
| + snippet.code_snippet, kFunctionName);
|
| +
|
| + BytecodeGraphTester tester(isolate, zone, script.start());
|
| + auto callable = tester.GetCallable<>();
|
| + Handle<Object> return_value = callable().ToHandleChecked();
|
| + CHECK(return_value->SameValue(*snippet.return_value()));
|
| +}
|
| +
|
| } // namespace compiler
|
| } // namespace internal
|
| } // namespace v8
|
|
|