Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Unified Diff: test/cctest/test-debug.cc

Issue 1213783002: Put getter functions on Script line-endings objects (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/cctest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « test/cctest/cctest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698