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

Unified Diff: test/mjsunit/debug-stepout-scope-part6.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-part5.js ('k') | test/mjsunit/debug-stepout-scope-part7.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/debug-stepout-scope-part6.js
diff --git a/test/mjsunit/harmony/debug-evaluate-blockscopes.js b/test/mjsunit/debug-stepout-scope-part6.js
similarity index 55%
copy from test/mjsunit/harmony/debug-evaluate-blockscopes.js
copy to test/mjsunit/debug-stepout-scope-part6.js
index d6ce8b2b6a8c8050e1769297f865d06cf007bc6b..f7c8df0bc84cc5282d8a66a0af4906eed4e66f46 100644
--- a/test/mjsunit/harmony/debug-evaluate-blockscopes.js
+++ b/test/mjsunit/debug-stepout-scope-part6.js
@@ -25,46 +25,55 @@
// (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 bodies = [ "1",
+ "1 ",
+ "1;",
+ "1; ",
+ "q",
+ "q ",
+ "q;",
+ "q; ",
+ "try { throw 'stuff' } catch (e) { e = 1; }",
+ "try { throw 'stuff' } catch (e) { e = 1; } ",
+ "try { throw 'stuff' } catch (e) { e = 1; };",
+ "try { throw 'stuff' } catch (e) { e = 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);
+// Test global eval and function constructor.
+for (var i = 0; i < prefixes.length; ++i) {
+ var pre = prefixes[i];
+ for (var j = 0; j < bodies.length; ++j) {
+ var body = bodies[j];
+ eval("'use strict'; " + pre + body);
+ }
+}
« no previous file with comments | « test/mjsunit/debug-stepout-scope-part5.js ('k') | test/mjsunit/debug-stepout-scope-part7.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698