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

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

Issue 861093002: Support intercepted getters, setters and index operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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_interceptors_test.dart
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart
index ef56ac0342b592dce9223fcaee0d7560871133d7..da5691842a168afdc17a4ac0424d338c02d1cc21 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart
@@ -22,9 +22,48 @@ function() {
var g, v0;
g = 1;
v0 = 3;
- P.print(J.getInterceptor(g).$add(g, v0));
+ P.print(J.getInterceptor$ns(g).$add(g, v0));
return null;
}"""),
+ const TestEntry("""
+main() {
+ var l = ['hest', ['h', 'e', 's', 't']];
+ print(l.length);
+ for (int i = 0; i < l.length; i++) {
+ var x = l[i];
+ for (int j = 0; j < x.length; j++) {
+ print(x[j]);
+ }
+ }
+}""",
+r"""
+function() {
+ var l, i, v0, x, j, v1, v2, v3;
+ l = ["hest", ["h", "e", "s", "t"]];
+ P.print(J.getInterceptor$as(l).get$length(l));
+ i = 0;
+ L0:
+ while (true) {
+ v0 = J.getInterceptor$as(l).get$length(l);
+ if (P.identical(J.getInterceptor$n(i).$lt(i, v0), true)) {
+ x = J.getInterceptor$as(l).$index(l, i);
+ j = 0;
+ while (true) {
+ v1 = J.getInterceptor$as(x).get$length(x);
+ if (P.identical(J.getInterceptor$n(j).$lt(j, v1), true)) {
+ P.print(J.getInterceptor$as(x).$index(x, j));
+ v2 = 1;
+ j = J.getInterceptor$ns(j).$add(j, v2);
+ } else {
+ v3 = 1;
+ i = J.getInterceptor$ns(i).$add(i, v3);
+ continue L0;
+ }
+ }
+ } else
+ return null;
+ }
+}"""),
];

Powered by Google App Engine
This is Rietveld 408576698