| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012, 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 A { |
| 8 var __PROTO__ = 499; |
| 9 var constructor = 1; |
| 10 var prototype = 2; |
| 11 } |
| 12 |
| 13 // TODO(jmesserly): changed this test to avoid shadowing a field with a getter, |
| 14 // which DDC doesn't currently support, see: |
| 15 // https://github.com/dart-lang/dev_compiler/issues/52 |
| 16 class A2 { |
| 17 get __PROTO__ => 499; |
| 18 get constructor => 1; |
| 19 get prototype => 2; |
| 20 } |
| 21 |
| 22 class B extends A2 { |
| 23 get __PROTO__ => 42; |
| 24 get constructor => 3; |
| 25 get prototype => 4; |
| 26 } |
| 27 |
| 28 main() { |
| 29 var a = new A(); |
| 30 var a2 = new A2(); |
| 31 var b = new B(); |
| 32 var list = [a, a2, b]; |
| 33 for (int i = 0; i < list.length; i++) { |
| 34 var proto = list[i].__PROTO__; |
| 35 var constructor = list[i].constructor; |
| 36 var prototype = list[i].prototype; |
| 37 if (i < 2) { |
| 38 Expect.equals(499, proto); |
| 39 Expect.equals(1, constructor); |
| 40 Expect.equals(2, prototype); |
| 41 } else { |
| 42 Expect.equals(42, proto); |
| 43 Expect.equals(3, constructor); |
| 44 Expect.equals(4, prototype); |
| 45 } |
| 46 } |
| 47 } |
| OLD | NEW |