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

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

Issue 1223813006: dart2js cps: Direct access on JS arrays. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update unit tests and remove unused functions Created 5 years, 5 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/js_backend_cps_ir_operators_test.dart
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
index 577dca099a59ecef9a46a86d13a94879ad66f025..138e68446547196ae53442b8289a4d0b59c5a1dc 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
@@ -14,17 +14,16 @@ const List<TestEntry> tests = const [
foo() => foo();
main() {
print(foo() ? "hello world" : "bad bad");
-}""",
-"""function() {
- V.foo();
- P.print("bad bad");
+}""","""
+function() {
+ P.print(V.foo() ? "hello world" : "bad bad");
}"""),
const TestEntry("""
foo() => null;
main() {
print(foo() ? "hello world" : "bad bad");
-}""",
-"""function() {
+}""","""
+function() {
V.foo();
P.print("bad bad");
}"""),
@@ -32,25 +31,23 @@ main() {
get foo => foo;
main() {
print(foo ? "hello world" : "bad bad");
-}""",
-"""function() {
- V.foo();
- P.print("bad bad");
+}""","""
+function() {
+ P.print(V.foo() ? "hello world" : "bad bad");
}"""),
const TestEntry("""
get foo => foo;
-main() { print(foo && foo); }""",
-"""function() {
- V.foo();
- P.print(false);
+main() { print(foo && foo); }
+""", """
+function() {
+ P.print(V.foo() ? !!P.identical(V.foo(), true) : false);
}"""),
const TestEntry("""
get foo => foo;
-main() { print(foo || foo); }""",
-"""function() {
- V.foo();
- V.foo();
- P.print(false);
+main() { print(foo || foo); }
+""","""
+function() {
+ P.print(V.foo() ? true : !!P.identical(V.foo(), true));
}"""),
// Needs interceptor calling convention
@@ -76,8 +73,10 @@ main() {
print(list);
}""", r"""
function() {
- var list = [1, 2, 3];
- J.getInterceptor$a(list).$indexSet(list, 1, 6);
+ var list = [1, 2, 3], v0 = 1;
+ if (v0 < 0 || v0 >= list.length)
+ H.ioore(list, v0);
+ list[v0] = 6;
P.print(list);
}"""),
];

Powered by Google App Engine
This is Rietveld 408576698