Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 import "package:expect/expect.dart"; | |
| 6 | |
| 7 class NoInline { | |
|
kasperl
2013/06/06 08:15:12
DontInline?
ngeoffray
2013/06/06 08:44:00
Done.
| |
| 8 const NoInline(); | |
| 9 } | |
| 10 | |
| 11 var a = [null]; | |
| 12 | |
| 13 class A { | |
| 14 var foo; | |
| 15 var bar; | |
| 16 | |
| 17 @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!
| |
| 18 A() { | |
| 19 // Currently defeat inlining by using a closure. | |
| 20 bar = () => 42; | |
| 21 foo = 42; | |
| 22 foo = a[0]; | |
| 23 } | |
| 24 } | |
| 25 | |
| 26 main() { | |
| 27 new A(); | |
| 28 bar(); | |
| 29 new A(); | |
| 30 } | |
| 31 | |
| 32 @NoInline | |
| 33 bar() { | |
| 34 // Currently defeat inlining by using a closure. | |
| 35 Expect.throws(() => new A().foo + 42, (e) => e is NoSuchMethodError); | |
| 36 } | |
| OLD | NEW |