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

Unified Diff: dart/tests/compiler/dart2js/mirrors_used_test.dart

Issue 22301009: Retain fewer names for reflection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make sure that receiver-less symbols are retained when there is insufficient @MirrorsUsed. Created 7 years, 4 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: dart/tests/compiler/dart2js/mirrors_used_test.dart
diff --git a/dart/tests/compiler/dart2js/mirrors_used_test.dart b/dart/tests/compiler/dart2js/mirrors_used_test.dart
index f3719a5cdc3353b294c976bc46c93e478eb3b18f..75623b9a39b96992699e2fe7c8001315f503a3e8 100644
--- a/dart/tests/compiler/dart2js/mirrors_used_test.dart
+++ b/dart/tests/compiler/dart2js/mirrors_used_test.dart
@@ -54,6 +54,19 @@ void main() {
'Too many compiled methods: '
'${generatedCode.length} > $expectedMethodCount');
+ // The following names should be retained:
+ List expectedNames = [
+ 'Foo', // The name of class Foo.
+ r'Foo$', // The name of class Foo's constructor.
+ 'Foo_staticMethod', // The name of Foo.staticMethod.
+ r'get$field', // The (getter) name of Foo.field.
+ r'instanceMethod$0']; // The name of Foo.instanceMethod.
+ Set recordedNames = new Set()
+ ..addAll(compiler.backend.emitter.recordedMangledNames)
+ ..addAll(compiler.backend.emitter.mangledFieldNames.keys)
+ ..addAll(compiler.backend.emitter.mangledGlobalFieldNames.keys);
+ Expect.setEquals(new Set.from(expectedNames), recordedNames);
+
for (var library in compiler.libraries.values) {
library.forEachLocalMember((member) {
if (library == compiler.mainApp

Powered by Google App Engine
This is Rietveld 408576698