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

Side by Side Diff: dart/language/namer_test.dart

Issue 10581036: Ensure uniqueness of global names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update comment Created 8 years, 6 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
« no previous file with comments | « dart/.gitignore ('k') | dart/lib/compiler/implementation/namer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
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.
4
5 // Regression test for a bug in dart2js where global names could
6 // collide.
7
8 var i = 'top level';
9
10 var i0 = 'top level zero';
11
12 var i00 = 'top level zero zero';
13
14 var i2 = 'top level too';
15
16 class A {
17 static var i = 'A';
18 }
19
20 var j = 'top level';
21
22 var j0 = 'top level zero';
23
24 var j00 = 'top level zero zero';
25
26 var j2 = 'top level too';
27
28 class B {
29 static var j = 'B';
30 }
31
32 var k = 'top level';
33
34 var k0 = 'top level zero';
35
36 var k00 = 'top level zero zero';
37
38 var k2 = 'top level too';
39
40 class C {
41 static var k = 'C';
42 }
43
44 main() {
45 // Order matters. This sequence triggered the bug.
46 Expect.equals('top level', i);
47 Expect.equals('A', A.i);
48 Expect.equals('top level too', i2);
49 Expect.equals('top level zero zero', i00);
50 Expect.equals('top level zero', i0);
51
52 Expect.equals('top level zero zero', j00);
53 Expect.equals('top level', j);
54 Expect.equals('top level too', j2);
55 Expect.equals('top level zero', j0);
56 Expect.equals('B', B.j);
57
58 Expect.equals('top level too', k2);
59 Expect.equals('top level zero', k0);
60 Expect.equals('top level', k);
61 Expect.equals('C', C.k);
62 Expect.equals('top level zero zero', k00);
63 }
OLDNEW
« no previous file with comments | « dart/.gitignore ('k') | dart/lib/compiler/implementation/namer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698