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

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

Issue 1438633002: js_ast: Avoid precedence issue with negative numbers as receivers at calls (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « pkg/js_ast/lib/src/printer.dart ('k') | tests/compiler/dart2js_native/js_constant_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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),
]));
}
« no previous file with comments | « pkg/js_ast/lib/src/printer.dart ('k') | tests/compiler/dart2js_native/js_constant_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698