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

Side by Side Diff: tests/compiler/dart2js/private_test.dart

Issue 887643002: Fix private_test to reflect new, better warning. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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 4
5 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "package:async_helper/async_helper.dart"; 6 import "package:async_helper/async_helper.dart";
7 import 'mock_compiler.dart'; 7 import 'mock_compiler.dart';
8 8
9 import 'package:compiler/src/io/source_file.dart'; 9 import 'package:compiler/src/io/source_file.dart';
10 import 'package:compiler/src/dart2jslib.dart'; 10 import 'package:compiler/src/dart2jslib.dart';
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 analyze('var value = publicClass.private.publicMethod;'); 124 analyze('var value = publicClass.private.publicMethod;');
125 // Call public method on private class. 125 // Call public method on private class.
126 analyze('publicClass.private.publicMethod();'); 126 analyze('publicClass.private.publicMethod();');
127 127
128 // Call unnamed (public) constructor on public class. 128 // Call unnamed (public) constructor on public class.
129 analyze('publicClass = new PublicClass();'); 129 analyze('publicClass = new PublicClass();');
130 // Call public constructor on public class. 130 // Call public constructor on public class.
131 analyze('publicClass = new PublicClass.publicConstructor();'); 131 analyze('publicClass = new PublicClass.publicConstructor();');
132 // Call private constructor on public class. 132 // Call private constructor on public class.
133 analyze('publicClass = new PublicClass._privateConstructor();', 133 analyze('publicClass = new PublicClass._privateConstructor();',
134 MessageKind.CANNOT_FIND_CONSTRUCTOR); 134 MessageKind.PRIVATE_ACCESS);
135 // Read from private field on public class. 135 // Read from private field on public class.
136 analyze('var value = publicClass._privateField;', 136 analyze('var value = publicClass._privateField;',
137 MessageKind.PRIVATE_ACCESS); 137 MessageKind.PRIVATE_ACCESS);
138 // Write to private field on public class. 138 // Write to private field on public class.
139 analyze('publicClass._privateField = 0;', 139 analyze('publicClass._privateField = 0;',
140 MessageKind.PRIVATE_ACCESS); 140 MessageKind.PRIVATE_ACCESS);
141 // Call private getter on public class. 141 // Call private getter on public class.
142 analyze('var value = publicClass._privateGetter;', 142 analyze('var value = publicClass._privateGetter;',
143 MessageKind.PRIVATE_ACCESS); 143 MessageKind.PRIVATE_ACCESS);
144 // Call private setter on public class. 144 // Call private setter on public class.
(...skipping 13 matching lines...) Expand all
158 // Call public getter on public class. 158 // Call public getter on public class.
159 analyze('var value = publicClass.publicGetter;'); 159 analyze('var value = publicClass.publicGetter;');
160 // Call public setter on public class. 160 // Call public setter on public class.
161 analyze('publicClass.publicSetter = 0;'); 161 analyze('publicClass.publicSetter = 0;');
162 // Access public method on public class. 162 // Access public method on public class.
163 analyze('var value = publicClass.publicMethod;'); 163 analyze('var value = publicClass.publicMethod;');
164 // Call public method on public class. 164 // Call public method on public class.
165 analyze('publicClass.publicMethod();'); 165 analyze('publicClass.publicMethod();');
166 } 166 }
167 167
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698