Chromium Code Reviews| Index: tests/language/multiple_field_assignment_constructor_test.dart |
| =================================================================== |
| --- tests/language/multiple_field_assignment_constructor_test.dart (revision 0) |
| +++ tests/language/multiple_field_assignment_constructor_test.dart (revision 0) |
| @@ -0,0 +1,36 @@ |
| +// Copyright (c) 2013, 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. |
| + |
| +import "package:expect/expect.dart"; |
| + |
| +class NoInline { |
|
kasperl
2013/06/06 08:15:12
DontInline?
ngeoffray
2013/06/06 08:44:00
Done.
|
| + const NoInline(); |
| +} |
| + |
| +var a = [null]; |
| + |
| +class A { |
| + var foo; |
| + var bar; |
| + |
| + @NoInline |
|
kasperl
2013/06/06 08:15:12
What's the purpose of this annotation? Are you exp
ngeoffray
2013/06/06 08:44:00
Yeah, more like a marker that this test depends on
kasperl
2013/06/06 08:45:30
SGTM!
|
| + A() { |
| + // Currently defeat inlining by using a closure. |
| + bar = () => 42; |
| + foo = 42; |
| + foo = a[0]; |
| + } |
| +} |
| + |
| +main() { |
| + new A(); |
| + bar(); |
| + new A(); |
| +} |
| + |
| +@NoInline |
| +bar() { |
| + // Currently defeat inlining by using a closure. |
| + Expect.throws(() => new A().foo + 42, (e) => e is NoSuchMethodError); |
| +} |