Index: tests/compiler/dart2js/js_constant_test.dart |
diff --git a/tests/compiler/dart2js/js_spec_optimization_test.dart b/tests/compiler/dart2js/js_constant_test.dart |
similarity index 52% |
copy from tests/compiler/dart2js/js_spec_optimization_test.dart |
copy to tests/compiler/dart2js/js_constant_test.dart |
index 3c03c09e299b70f0200740d27350348d77c4ee08..6165cfa8a59fb12073da751707b424ab533bff05 100644 |
--- a/tests/compiler/dart2js/js_spec_optimization_test.dart |
+++ b/tests/compiler/dart2js/js_constant_test.dart |
@@ -10,50 +10,9 @@ import 'compiler_helper.dart'; |
const String TEST_1 = r""" |
import 'dart:_foreign_helper'; |
main() { |
- // present: 'Moose' |
- JS('', 'Moose'); |
- |
- // absent: 'Phantom' - pure. |
- JS('returns: bool;effects:none;depends:none;throws:never', 'Phantom'); |
- |
- // present: 'Spider' - unused after constant folding 'is', but unpure. |
- print(JS('returns:bool;effects:none;depends:all', 'Spider') is bool); |
- |
- // absent: 'Wasp' - unused after constant folding 'is', and unpure. |
- print(JS('returns:bool;effects:none;depends:all;throws:never', 'Wasp') |
- is bool); |
- |
- JS('', 'Array'); // absent: "Array" |
- } |
-"""; |
- |
-const String TEST_2 = r""" |
- import 'dart:_foreign_helper'; |
- main() { |
- var w1 = JS('returns:int;depends:none;effects:none;throws:never', |
- 'foo(#)', 1); |
- var w2 = JS('returns:int;depends:none;effects:none;throws:never', |
- 'foo(#)', 2); |
- |
- print([w2, w1]); |
- |
- // present: '[foo(2), foo(1)]' - since 'foo' is pure, we expect to generate |
- // code out-of-order. |
- } |
-"""; |
- |
-const String TEST_3 = r""" |
- import 'dart:_foreign_helper'; |
- main() { |
- var s = JS('String|Null', '"Hello"'); |
- var s1 = JS('returns:String;depends:none;effects:none;throws:null(1)', |
- '#.toLowerCase()', s); |
- var s2 = JS('returns:String;depends:none;effects:none;throws:null(1)', |
- '#.toUpperCase()', s); |
- print(s2); |
- |
- // absent: 'toLowerCase' - removed since s.toUpperCase() generates the same |
- // noSuchMethod. |
+ JS('', '#.toString()', -5); |
+ // absent: "5.toString" |
+ // present: "(-5).toString" |
} |
"""; |
@@ -89,7 +48,5 @@ main() { |
asyncTest(() => Future.wait([ |
check(TEST_1), |
- check(TEST_2), |
- check(TEST_3), |
])); |
} |