| Index: test/cctest/test-debug.cc
|
| diff --git a/test/cctest/test-debug.cc b/test/cctest/test-debug.cc
|
| index 6ff7656f2577c837a1c8d2ae3dc8b82e82c4385b..4404409a97af8becf8065b5705200ff5626012f5 100644
|
| --- a/test/cctest/test-debug.cc
|
| +++ b/test/cctest/test-debug.cc
|
| @@ -6000,12 +6000,21 @@ TEST(DebugGetLoadedScripts) {
|
| bool allow_natives_syntax = i::FLAG_allow_natives_syntax;
|
| i::FLAG_allow_natives_syntax = true;
|
| EnableDebugger();
|
| - CompileRun(
|
| - "var scripts = %DebugGetLoadedScripts();"
|
| - "var count = scripts.length;"
|
| - "for (var i = 0; i < count; ++i) {"
|
| - " scripts[i].line_ends;"
|
| - "}");
|
| + v8::MaybeLocal<v8::Value> result =
|
| + CompileRun(env.context(),
|
| + "var scripts = %DebugGetLoadedScripts();"
|
| + "var count = scripts.length;"
|
| + "for (var i = 0; i < count; ++i) {"
|
| + " var lines = scripts[i].lineCount();"
|
| + " if (lines < 1) throw 'lineCount';"
|
| + " var last = -1;"
|
| + " for (var j = 0; j < lines; ++j) {"
|
| + " var end = scripts[i].lineEnd(j);"
|
| + " if (last >= end) throw 'lineEnd';"
|
| + " last = end;"
|
| + " }"
|
| + "}");
|
| + CHECK(!result.IsEmpty());
|
| DisableDebugger();
|
| // Must not crash while accessing line_ends.
|
| i::FLAG_allow_natives_syntax = allow_natives_syntax;
|
|
|