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 escape(object) { | |
| 8 print(object.field + 42); | |
| 9 } | |
| 10 | |
| 11 class A { | |
| 12 A() { | |
| 13 escape(this); | |
| 14 } | |
| 15 } | |
| 16 | |
| 17 class B extends A { | |
| 18 var field; | |
| 19 B() { | |
| 20 field = 42; | |
| 21 } | |
| 22 } | |
| 23 | |
| 24 main() { | |
| 25 Expect.throws(() => new B(), (e) => e is NoSuchMethodError); | |
| 26 } | |
| OLD | NEW |