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

Unified Diff: tests/language/scope_variable2_test.dart

Issue 24488004: Implement correct scoping rules for variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: tests/language/scope_variable2_test.dart
diff --git a/tests/language/bootstrap_test.dart b/tests/language/scope_variable2_test.dart
similarity index 50%
copy from tests/language/bootstrap_test.dart
copy to tests/language/scope_variable2_test.dart
index 747dbf9e4bae1ff32d8597a228719fbe31a73d7c..c05a53191cbc255801c2c9aa8c00f4d606dd691a 100644
--- a/tests/language/bootstrap_test.dart
+++ b/tests/language/scope_variable2_test.dart
@@ -1,19 +1,21 @@
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// Dart test for testing binary operations.
-// VMOptions=--verify_implements --check-function-fingerprints
-class BootstrapTest {
+var x = 0;
- static testMain() {
- var obj = new Object();
-
- return obj;
+f(y) {
+ var z = x; /// 01: compile-time error
+ if (y) {
+ x = x + 1; /// 02: compile-time error
+ print(x); /// 03: compile-time error
}
-
+ var x
+ = x++ /// 04: compile-time error
+ ;
+ print(x);
}
main() {
- BootstrapTest.testMain();
+ f(true);
}

Powered by Google App Engine
This is Rietveld 408576698