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

Unified Diff: test/mjsunit/harmony/debug-stepin-collections-foreach.js

Issue 427723002: Enable ES6 Map and Set by default (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove old test, fix BUILD.gn Created 6 years, 4 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/mjsunit/harmony/collections.js ('k') | test/mjsunit/harmony/mirror-collections.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/debug-stepin-collections-foreach.js
diff --git a/test/mjsunit/harmony/debug-stepin-collections-foreach.js b/test/mjsunit/harmony/debug-stepin-collections-foreach.js
deleted file mode 100644
index 30fa8c00492667d2ec404da87c0f39a10120d5b0..0000000000000000000000000000000000000000
--- a/test/mjsunit/harmony/debug-stepin-collections-foreach.js
+++ /dev/null
@@ -1,118 +0,0 @@
-// Copyright 2014 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.
-//
-// Flags: --expose-debug-as debug --harmony-collections
-
-Debug = debug.Debug
-
-var exception = false;
-
-function listener(event, exec_state, event_data, data) {
- try {
- if (event == Debug.DebugEvent.Break) {
- if (breaks == 0) {
- exec_state.prepareStep(Debug.StepAction.StepIn, 2);
- breaks = 1;
- } else if (breaks <= 3) {
- breaks++;
- // Check whether we break at the expected line.
- print(event_data.sourceLineText());
- assertTrue(event_data.sourceLineText().indexOf("Expected to step") > 0);
- exec_state.prepareStep(Debug.StepAction.StepIn, 3);
- }
- }
- } catch (e) {
- exception = true;
- }
-}
-
-function cb_set(num) {
- print("element " + num); // Expected to step to this point.
- return true;
-}
-
-function cb_map(key, val) {
- print("key " + key + ", value " + val); // Expected to step to this point.
- return true;
-}
-
-var s = new Set();
-s.add(1);
-s.add(2);
-s.add(3);
-s.add(4);
-
-var m = new Map();
-m.set('foo', 1);
-m.set('bar', 2);
-m.set('baz', 3);
-m.set('bat', 4);
-
-Debug.setListener(listener);
-
-var breaks = 0;
-debugger;
-s.forEach(cb_set);
-assertFalse(exception);
-assertEquals(4, breaks);
-
-breaks = 0;
-debugger;
-m.forEach(cb_map);
-assertFalse(exception);
-assertEquals(4, breaks);
-
-Debug.setListener(null);
-
-
-// Test two levels of builtin callbacks:
-// Array.forEach calls a callback function, which by itself uses
-// Array.forEach with another callback function.
-
-function second_level_listener(event, exec_state, event_data, data) {
- try {
- if (event == Debug.DebugEvent.Break) {
- if (breaks == 0) {
- exec_state.prepareStep(Debug.StepAction.StepIn, 3);
- breaks = 1;
- } else if (breaks <= 16) {
- breaks++;
- // Check whether we break at the expected line.
- assertTrue(event_data.sourceLineText().indexOf("Expected to step") > 0);
- // Step two steps further every four breaks to skip the
- // forEach call in the first level of recurision.
- var step = (breaks % 4 == 1) ? 6 : 3;
- exec_state.prepareStep(Debug.StepAction.StepIn, step);
- }
- }
- } catch (e) {
- exception = true;
- }
-}
-
-function cb_set_foreach(num) {
- s.forEach(cb_set);
- print("back to the first level of recursion.");
-}
-
-function cb_map_foreach(key, val) {
- m.forEach(cb_set);
- print("back to the first level of recursion.");
-}
-
-Debug.setListener(second_level_listener);
-
-breaks = 0;
-debugger;
-s.forEach(cb_set_foreach);
-assertFalse(exception);
-assertEquals(17, breaks);
-
-breaks = 0;
-debugger;
-m.forEach(cb_map_foreach);
-assertFalse(exception);
-assertEquals(17, breaks);
-
-Debug.setListener(null);
« no previous file with comments | « test/mjsunit/harmony/collections.js ('k') | test/mjsunit/harmony/mirror-collections.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698