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

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

Issue 10824329: dart2dart properly collect top level fields (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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: tests/compiler/dart2js/unparser_test.dart
diff --git a/tests/compiler/dart2js/unparser_test.dart b/tests/compiler/dart2js/unparser_test.dart
index 2e6ffe191762b033d33bfc80dff4ba8f6e91a62c..3fabfaa9f4a7ba52741ccdcbd2d05c69c04aeb83 100644
--- a/tests/compiler/dart2js/unparser_test.dart
+++ b/tests/compiler/dart2js/unparser_test.dart
@@ -227,6 +227,8 @@ testConflictSendsRename() {
#library("mylib.dart");
globalfoo() {}
+var globalVar;
Anton Muhin 2012/08/16 11:05:48 just for fun, let's try variable lists, something
Roman 2012/08/16 11:46:09 Done.
+var globalVarInitialized = 6;
class A {
A(){}
@@ -240,6 +242,8 @@ class A {
#import("mylib.dart", prefix: "mylib");
globalfoo() {}
+var globalVar;
+var globalVarInitialized = 6;
class A {
A(){}
@@ -250,6 +254,8 @@ class A {
}
main() {
+ globalVar;
+ globalVarInitialized;
globalfoo();
A.field;
A.staticfoo();
@@ -257,6 +263,8 @@ main() {
new A.fromFoo();
new A().foo();
+ mylib.globalVar;
+ mylib.globalVarInitialized;
mylib.globalfoo();
mylib.A.field;
mylib.A.staticfoo();
@@ -265,7 +273,7 @@ main() {
new mylib.A().foo();
}
''';
- var expectedResult = 'globalfoo(){}p_globalfoo(){}main(){p_globalfoo(); p_A.field; p_A.staticfoo(); new p_A(); new p_A.fromFoo(); new p_A().foo(); globalfoo(); A.field; A.staticfoo(); new A(); new A.fromFoo(); new A().foo();}class p_A{p_A(){}p_A.fromFoo(){}foo(){}static staticfoo(){}static final field=5;}class A{A(){}A.fromFoo(){}foo(){}static staticfoo(){}static final field=5;}';
+ var expectedResult = 'globalfoo(){}p_globalfoo(){}main(){globalVar; globalVarInitialized; p_globalfoo(); A.field; A.staticfoo(); new A(); new A.fromFoo(); new A().foo(); p_globalVar; p_globalVarInitialized; globalfoo(); p_A.field; p_A.staticfoo(); new p_A(); new p_A.fromFoo(); new p_A().foo();}var globalVar;var p_globalVar;var globalVarInitialized=6;var p_globalVarInitialized=6;class A{A(){}A.fromFoo(){}foo(){}static staticfoo(){}static final field=5;}class p_A{p_A(){}p_A.fromFoo(){}foo(){}static staticfoo(){}static final field=5;}';
testDart2DartWithLibrary(mainSrc, librarySrc,
(String result) { Expect.equals(expectedResult, result); });
}

Powered by Google App Engine
This is Rietveld 408576698