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

Unified Diff: test/mjsunit/debug-evaluate-locals.js

Issue 6357007: Make 'with' mark only variables occurring in the body as used. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build/ia32
Patch Set: Created 9 years, 11 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 | « src/scopes.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/debug-evaluate-locals.js
diff --git a/test/mjsunit/debug-evaluate-locals.js b/test/mjsunit/debug-evaluate-locals.js
index 4b87829169586ed4885bee9236138ecbd51faa87..8bc6a617cfeba27dc5fe8a7954d24a93fd9b590c 100644
--- a/test/mjsunit/debug-evaluate-locals.js
+++ b/test/mjsunit/debug-evaluate-locals.js
@@ -34,18 +34,18 @@ exception = false;
function checkFrame0(name, value) {
- assertTrue(name == 'a' || name == 'b');
+ assertTrue(name == 'a' || name == 'b', 'check name');
if (name == 'a') {
assertEquals(1, value);
- }
- if (name == 'b') {
+ } else if (name == 'b') {
assertEquals(2, value);
}
}
function checkFrame1(name, value) {
- assertTrue(name == '.arguments' || name == 'a');
+ assertTrue(name == '.arguments' || name == 'arguments' || name == 'a',
+ 'check name');
if (name == 'a') {
assertEquals(3, value);
}
@@ -53,8 +53,7 @@ function checkFrame1(name, value) {
function checkFrame2(name, value) {
- assertTrue(name == '.arguments' || name == 'a' ||
- name == 'arguments' || name == 'b');
+ assertTrue(name == 'a' || name == 'b');
if (name == 'a') {
assertEquals(5, value);
}
@@ -73,18 +72,17 @@ function listener(event, exec_state, event_data, data) {
checkFrame0(frame0.localName(0), frame0.localValue(0).value());
checkFrame0(frame0.localName(1), frame0.localValue(1).value());
- // Frame 1 has normal variable a (and the .arguments variable).
+ // Frame 1 has normal variables a and arguments (and the .arguments
+ // variable).
var frame1 = exec_state.frame(1);
checkFrame1(frame1.localName(0), frame1.localValue(0).value());
checkFrame1(frame1.localName(1), frame1.localValue(1).value());
+ checkFrame1(frame1.localName(2), frame1.localValue(2).value());
- // Frame 2 has normal variables a and b (and both the .arguments and
- // arguments variable).
+ // Frame 2 has normal variables a and b.
var frame2 = exec_state.frame(2);
checkFrame2(frame2.localName(0), frame2.localValue(0).value());
checkFrame2(frame2.localName(1), frame2.localValue(1).value());
- checkFrame2(frame2.localName(2), frame2.localValue(2).value());
- checkFrame2(frame2.localName(3), frame2.localValue(3).value());
// Evaluating a and b on frames 0, 1 and 2 produces 1, 2, 3, 4, 5 and 6.
assertEquals(1, exec_state.frame(0).evaluate('a').value());
« no previous file with comments | « src/scopes.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698