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

Unified Diff: tests/language/regress_21016_test.dart

Issue 598493003: Give up tracing of a function if one of its closurizations escapes tracing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/language/regress_21016_test.dart
diff --git a/tests/language/regress_21016_test.dart b/tests/language/regress_21016_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..1521bef9b7adc8f52655e4939957f2b3bb69469d
--- /dev/null
+++ b/tests/language/regress_21016_test.dart
@@ -0,0 +1,37 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Test that we give up on tracing a function if one of its closurizations
+// escapes tracing.
+
+class A {
+ var _boo = 22;
+ get boo {
+ return _boo;
+ return;
+ }
+}
+
+class B {
+ var _bar = 42;
+ get boo {
+ return _bar;
+ return;
+ }
+}
+
+class Holder {
+ tearMe(x) => x.boo;
+}
+
+var list = [];
+
+main () {
+ var holder = new Holder();
+ var hide = ((X) => X)(holder.tearMe);
+ hide(new A());
+ list.add(holder.tearMe);
+ var x = list[0];
+ x(new B());
+}

Powered by Google App Engine
This is Rietveld 408576698