@@ -5826,8 +5826,9 @@ Exports:
5826
5826
}
5827
5827
5828
5828
test_export_configurations_useDefault () async {
5829
- declaredVariables =
5830
- new DeclaredVariables .fromMap ({'dart.library.io' : 'false' });
5829
+ declaredVariables = new DeclaredVariables .fromMap ({
5830
+ 'dart.library.io' : 'false' ,
5831
+ });
5831
5832
addLibrarySource ('/foo.dart' , 'class A {}' );
5832
5833
addLibrarySource ('/foo_io.dart' , 'class A {}' );
5833
5834
addLibrarySource ('/foo_html.dart' , 'class A {}' );
@@ -5850,8 +5851,10 @@ Exports:
5850
5851
}
5851
5852
5852
5853
test_export_configurations_useFirst () async {
5853
- declaredVariables = new DeclaredVariables .fromMap (
5854
- {'dart.library.io' : 'true' , 'dart.library.html' : 'true' });
5854
+ declaredVariables = new DeclaredVariables .fromMap ({
5855
+ 'dart.library.io' : 'true' ,
5856
+ 'dart.library.html' : 'true' ,
5857
+ });
5855
5858
addLibrarySource ('/foo.dart' , 'class A {}' );
5856
5859
addLibrarySource ('/foo_io.dart' , 'class A {}' );
5857
5860
addLibrarySource ('/foo_html.dart' , 'class A {}' );
@@ -5874,8 +5877,10 @@ Exports:
5874
5877
}
5875
5878
5876
5879
test_export_configurations_useSecond () async {
5877
- declaredVariables = new DeclaredVariables .fromMap (
5878
- {'dart.library.io' : 'false' , 'dart.library.html' : 'true' });
5880
+ declaredVariables = new DeclaredVariables .fromMap ({
5881
+ 'dart.library.io' : 'false' ,
5882
+ 'dart.library.html' : 'true' ,
5883
+ });
5879
5884
addLibrarySource ('/foo.dart' , 'class A {}' );
5880
5885
addLibrarySource ('/foo_io.dart' , 'class A {}' );
5881
5886
addLibrarySource ('/foo_html.dart' , 'class A {}' );
@@ -6079,8 +6084,9 @@ Exports:
6079
6084
}
6080
6085
6081
6086
test_exportImport_configurations_useDefault () async {
6082
- declaredVariables =
6083
- new DeclaredVariables .fromMap ({'dart.library.io' : 'false' });
6087
+ declaredVariables = new DeclaredVariables .fromMap ({
6088
+ 'dart.library.io' : 'false' ,
6089
+ });
6084
6090
addLibrarySource ('/foo.dart' , 'class A {}' );
6085
6091
addLibrarySource ('/foo_io.dart' , 'class A {}' );
6086
6092
addLibrarySource ('/foo_html.dart' , 'class A {}' );
@@ -6103,8 +6109,10 @@ class B extends A {
6103
6109
}
6104
6110
6105
6111
test_exportImport_configurations_useFirst () async {
6106
- declaredVariables = new DeclaredVariables .fromMap (
6107
- {'dart.library.io' : 'true' , 'dart.library.html' : 'true' });
6112
+ declaredVariables = new DeclaredVariables .fromMap ({
6113
+ 'dart.library.io' : 'true' ,
6114
+ 'dart.library.html' : 'false' ,
6115
+ });
6108
6116
addLibrarySource ('/foo.dart' , 'class A {}' );
6109
6117
addLibrarySource ('/foo_io.dart' , 'class A {}' );
6110
6118
addLibrarySource ('/foo_html.dart' , 'class A {}' );
@@ -6126,6 +6134,32 @@ class B extends A {
6126
6134
expect (typeA.element.source.shortName, 'foo_io.dart' );
6127
6135
}
6128
6136
6137
+ test_exportImport_configurations_useSecond () async {
6138
+ declaredVariables = new DeclaredVariables .fromMap ({
6139
+ 'dart.library.io' : 'false' ,
6140
+ 'dart.library.html' : 'true' ,
6141
+ });
6142
+ addLibrarySource ('/foo.dart' , 'class A {}' );
6143
+ addLibrarySource ('/foo_io.dart' , 'class A {}' );
6144
+ addLibrarySource ('/foo_html.dart' , 'class A {}' );
6145
+ addLibrarySource ('/bar.dart' , r'''
6146
+ export 'foo.dart'
6147
+ if (dart.library.io) 'foo_io.dart'
6148
+ if (dart.library.html) 'foo_html.dart';
6149
+ ''' );
6150
+ var library = await checkLibrary (r'''
6151
+ import 'bar.dart';
6152
+ class B extends A {}
6153
+ ''' );
6154
+ checkElementText (library, r'''
6155
+ import 'bar.dart';
6156
+ class B extends A {
6157
+ }
6158
+ ''' );
6159
+ var typeA = library.definingCompilationUnit.getType ('B' ).supertype;
6160
+ expect (typeA.element.source.shortName, 'foo_html.dart' );
6161
+ }
6162
+
6129
6163
test_exports () async {
6130
6164
addLibrarySource ('/a.dart' , 'library a;' );
6131
6165
addLibrarySource ('/b.dart' , 'library b;' );
@@ -6958,6 +6992,78 @@ class B extends A {
6958
6992
expect (typeA.element.source.shortName, 'foo_io.dart' );
6959
6993
}
6960
6994
6995
+ test_import_configurations_useFirst_eqTrue () async {
6996
+ declaredVariables = new DeclaredVariables .fromMap ({
6997
+ 'dart.library.io' : 'true' ,
6998
+ 'dart.library.html' : 'true' ,
6999
+ });
7000
+ addLibrarySource ('/foo.dart' , 'class A {}' );
7001
+ addLibrarySource ('/foo_io.dart' , 'class A {}' );
7002
+ addLibrarySource ('/foo_html.dart' , 'class A {}' );
7003
+ var library = await checkLibrary (r'''
7004
+ import 'foo.dart'
7005
+ if (dart.library.io == 'true') 'foo_io.dart'
7006
+ if (dart.library.html == 'true') 'foo_html.dart';
7007
+
7008
+ class B extends A {}
7009
+ ''' );
7010
+ checkElementText (library, r'''
7011
+ import 'foo_io.dart';
7012
+ class B extends A {
7013
+ }
7014
+ ''' );
7015
+ var typeA = library.definingCompilationUnit.getType ('B' ).supertype;
7016
+ expect (typeA.element.source.shortName, 'foo_io.dart' );
7017
+ }
7018
+
7019
+ test_import_configurations_useSecond () async {
7020
+ declaredVariables = new DeclaredVariables .fromMap ({
7021
+ 'dart.library.io' : 'false' ,
7022
+ 'dart.library.html' : 'true' ,
7023
+ });
7024
+ addLibrarySource ('/foo.dart' , 'class A {}' );
7025
+ addLibrarySource ('/foo_io.dart' , 'class A {}' );
7026
+ addLibrarySource ('/foo_html.dart' , 'class A {}' );
7027
+ var library = await checkLibrary (r'''
7028
+ import 'foo.dart'
7029
+ if (dart.library.io) 'foo_io.dart'
7030
+ if (dart.library.html) 'foo_html.dart';
7031
+
7032
+ class B extends A {}
7033
+ ''' );
7034
+ checkElementText (library, r'''
7035
+ import 'foo_html.dart';
7036
+ class B extends A {
7037
+ }
7038
+ ''' );
7039
+ var typeA = library.definingCompilationUnit.getType ('B' ).supertype;
7040
+ expect (typeA.element.source.shortName, 'foo_html.dart' );
7041
+ }
7042
+
7043
+ test_import_configurations_useSecond_eqTrue () async {
7044
+ declaredVariables = new DeclaredVariables .fromMap ({
7045
+ 'dart.library.io' : 'false' ,
7046
+ 'dart.library.html' : 'true' ,
7047
+ });
7048
+ addLibrarySource ('/foo.dart' , 'class A {}' );
7049
+ addLibrarySource ('/foo_io.dart' , 'class A {}' );
7050
+ addLibrarySource ('/foo_html.dart' , 'class A {}' );
7051
+ var library = await checkLibrary (r'''
7052
+ import 'foo.dart'
7053
+ if (dart.library.io == 'true') 'foo_io.dart'
7054
+ if (dart.library.html == 'true') 'foo_html.dart';
7055
+
7056
+ class B extends A {}
7057
+ ''' );
7058
+ checkElementText (library, r'''
7059
+ import 'foo_html.dart';
7060
+ class B extends A {
7061
+ }
7062
+ ''' );
7063
+ var typeA = library.definingCompilationUnit.getType ('B' ).supertype;
7064
+ expect (typeA.element.source.shortName, 'foo_html.dart' );
7065
+ }
7066
+
6961
7067
test_import_deferred () async {
6962
7068
addLibrarySource ('/a.dart' , 'f() {}' );
6963
7069
var library = await checkLibrary ('''
0 commit comments