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

Side by Side 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, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // Dart test for testing binary operations.
5 // VMOptions=--verify_implements --check-function-fingerprints
6 4
7 class BootstrapTest { 5 var x = 0;
8 6
9 static testMain() { 7 f(y) {
10 var obj = new Object(); 8 var z = x; /// 01: compile-time error
11 9 if (y) {
12 return obj; 10 x = x + 1; /// 02: compile-time error
11 print(x); /// 03: compile-time error
13 } 12 }
14 13 var x
14 = x++ /// 04: compile-time error
15 ;
16 print(x);
15 } 17 }
16 18
17 main() { 19 main() {
18 BootstrapTest.testMain(); 20 f(true);
19 } 21 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698