OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 26 matching lines...) Expand all Loading... |
37 // Access scope details. | 37 // Access scope details. |
38 var scope_count = exec_state.frame().scopeCount(); | 38 var scope_count = exec_state.frame().scopeCount(); |
39 for (var i = 0; i < scope_count; i++) { | 39 for (var i = 0; i < scope_count; i++) { |
40 var scope = exec_state.frame().scope(i); | 40 var scope = exec_state.frame().scope(i); |
41 // assertTrue(scope.isScope()); | 41 // assertTrue(scope.isScope()); |
42 scope.scopeType(); | 42 scope.scopeType(); |
43 scope.scopeObject(); | 43 scope.scopeObject(); |
44 } | 44 } |
45 | 45 |
46 // Do steps until we reach the global scope again. | 46 // Do steps until we reach the global scope again. |
47 exec_state.prepareStep(Debug.StepAction.StepIn, 1); | 47 exec_state.prepareStep(Debug.StepAction.StepIn); |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
51 Debug.setListener(listener); | 51 Debug.setListener(listener); |
52 | 52 |
53 var q = 42; | 53 var q = 42; |
54 var prefixes = [ "debugger; ", | 54 var prefixes = [ "debugger; ", |
55 "if (false) { try { throw 0; } catch(x) { this.x = x; } }; debu
gger; " ]; | 55 "if (false) { try { throw 0; } catch(x) { this.x = x; } }; debu
gger; " ]; |
56 var with_bodies = [ "with ({}) {}", | 56 var with_bodies = [ "with ({}) {}", |
57 "with ({x:1}) x", | 57 "with ({x:1}) x", |
58 "with ({x:1}) x = 1", | 58 "with ({x:1}) x = 1", |
59 "with ({x:1}) x ", | 59 "with ({x:1}) x ", |
60 "with ({x:1}) x = 1 ", | 60 "with ({x:1}) x = 1 ", |
61 "with ({x:1}) x;", | 61 "with ({x:1}) x;", |
62 "with ({x:1}) x = 1;", | 62 "with ({x:1}) x = 1;", |
63 "with ({x:1}) x; ", | 63 "with ({x:1}) x; ", |
64 "with ({x:1}) x = 1; " ]; | 64 "with ({x:1}) x = 1; " ]; |
65 | 65 |
66 | 66 |
67 // Test global eval and function constructor. | 67 // Test global eval and function constructor. |
68 for (var i = 0; i < prefixes.length; ++i) { | 68 for (var i = 0; i < prefixes.length; ++i) { |
69 var pre = prefixes[i]; | 69 var pre = prefixes[i]; |
70 for (var j = 0; j < with_bodies.length; ++j) { | 70 for (var j = 0; j < with_bodies.length; ++j) { |
71 var body = with_bodies[j]; | 71 var body = with_bodies[j]; |
72 eval(pre + body); | 72 eval(pre + body); |
73 Function(pre + body)(); | 73 Function(pre + body)(); |
74 } | 74 } |
75 } | 75 } |
OLD | NEW |