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

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

Issue 715263003: Fix Context::declaration_context to account for script contexts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 | « src/contexts.cc ('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 677a2926989a3869d2ab6d74e5443fb214c9a1d4..4b41a65451205f04ddd9dca3a24347eaabcf641c 100644
--- a/test/cctest/test-debug.cc
+++ b/test/cctest/test-debug.cc
@@ -7618,3 +7618,38 @@ TEST(DebugBreakOnExceptionInObserveCallback) {
CHECK(CompileRun("callbackRan")->BooleanValue());
CHECK_EQ(1, exception_event_counter);
}
+
+
+static void DebugHarmonyScopingListener(
+ const v8::Debug::EventDetails& event_details) {
+ v8::DebugEvent event = event_details.GetEvent();
+ if (event != v8::Break) return;
+
+ int break_id = CcTest::i_isolate()->debug()->break_id();
+
+ char script[128];
+ i::Vector<char> script_vector(script, sizeof(script));
+ SNPrintF(script_vector, "%%GetFrameCount(%d)", break_id);
+ v8::Local<v8::Value> result = CompileRun(script);
+
+ CHECK_EQ(1, result->Int32Value());
+}
+
+
+TEST(DebugBreakInLexicalScopes) {
+ i::FLAG_harmony_scoping = true;
+ i::FLAG_allow_natives_syntax = true;
+
+ DebugLocalContext env;
+ v8::Isolate* isolate = env->GetIsolate();
+ v8::HandleScope scope(isolate);
+ v8::Debug::SetDebugEventListener(DebugHarmonyScopingListener);
+
+ CompileRun(
+ "'use strict'; \n"
+ "let x = 1; \n"
+ CompileRun(
+ "'use strict'; \n"
+ "let y = 1; \n"
+ "debugger \n");
+}
« no previous file with comments | « src/contexts.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698