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

Unified Diff: test/mjsunit/debug-stepout-scope-part3.js

Issue 10969061: Split test/mjsunit/debug-stepout-scope into smaller chunks (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fixed nit Created 8 years, 3 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/debug-stepout-scope-part2.js ('k') | test/mjsunit/debug-stepout-scope-part4.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/debug-stepout-scope-part3.js
diff --git a/test/mjsunit/harmony/debug-evaluate-blockscopes.js b/test/mjsunit/debug-stepout-scope-part3.js
similarity index 56%
copy from test/mjsunit/harmony/debug-evaluate-blockscopes.js
copy to test/mjsunit/debug-stepout-scope-part3.js
index d6ce8b2b6a8c8050e1769297f865d06cf007bc6b..16b085e5410449454353283ecd29a7bc18b63cca 100644
--- a/test/mjsunit/harmony/debug-evaluate-blockscopes.js
+++ b/test/mjsunit/debug-stepout-scope-part3.js
@@ -25,46 +25,56 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --expose-debug-as debug --harmony-scoping
+// Flags: --expose-debug-as debug --expose-natives-as=builtins
-// Test debug evaluation for functions without local context, but with
-// nested catch contexts.
+// Check that the ScopeIterator can properly recreate the scope at
+// every point when stepping through functions.
-// TODO(ES6): properly activate extended mode
-"use strict";
+var Debug = debug.Debug;
-var x;
-var result;
+function listener(event, exec_state, event_data, data) {
+ if (event == Debug.DebugEvent.Break) {
+ // Access scope details.
+ var scope_count = exec_state.frame().scopeCount();
+ for (var i = 0; i < scope_count; i++) {
+ var scope = exec_state.frame().scope(i);
+ // assertTrue(scope.isScope());
+ scope.scopeType();
+ scope.scopeObject();
+ }
-function f() {
- { // Line 1.
- let i = 1; // Line 2.
- try { // Line 3.
- throw 'stuff'; // Line 4.
- } catch (e) { // Line 5.
- x = 2; // Line 6.
+ // Do steps until we reach the global scope again.
+ if (true) {
+ exec_state.prepareStep(Debug.StepAction.StepInMin, 1);
}
}
-};
+}
-// Get the Debug object exposed from the debug context global object.
-var Debug = debug.Debug
-// Set breakpoint on line 6.
-var bp = Debug.setBreakPoint(f, 6);
+Debug.setListener(listener);
-function listener(event, exec_state, event_data, data) {
- if (event == Debug.DebugEvent.Break) {
- result = exec_state.frame().evaluate("i").value();
- }
-};
+var q = 42;
+var prefixes = [
+ "debugger; ",
+ "if (false) { try { throw 0; } catch(x) { return x; } }; debugger; " ];
+var with_bodies = [ "with ({}) {}",
+ "with ({x:1}) x",
+ "with ({x:1}) x = 1",
+ "with ({x:1}) x ",
+ "with ({x:1}) x = 1 ",
+ "with ({x:1}) x;",
+ "with ({x:1}) x = 1;",
+ "with ({x:1}) x; ",
+ "with ({x:1}) x = 1; " ];
-// Add the debug event listener.
-Debug.setListener(listener);
-result = -1;
-f();
-assertEquals(1, result);
-// Clear breakpoint.
-Debug.clearBreakPoint(bp);
-// Get rid of the debug event listener.
-Debug.setListener(null);
+function test9() {
+ debugger;
+ for (var i = 0; i < prefixes.length; ++i) {
+ var pre = prefixes[i];
+ for (var j = 0; j < with_bodies.length; ++j) {
+ var body = with_bodies[j];
+ eval(pre + body);
+ }
+ }
+}
+test9();
« no previous file with comments | « test/mjsunit/debug-stepout-scope-part2.js ('k') | test/mjsunit/debug-stepout-scope-part4.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698