OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 // Test that JavaScript properties on Object can still be classes in | 4 // Test that JavaScript properties on Object can still be classes in |
5 // Dart. | 5 // Dart. |
6 | 6 |
7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
8 | 8 |
9 void main() { | 9 void main() { |
10 Expect.equals(42, new __defineGetter__().hello()); | 10 Expect.equals(42, new __defineGetter__().hello()); |
11 Expect.equals(42, new __defineSetter__().hello()); | 11 Expect.equals(42, new __defineSetter__().hello()); |
12 Expect.equals(42, new __lookupGetter__().hello()); | 12 Expect.equals(42, new __lookupGetter__().hello()); |
13 Expect.equals(42, new __lookupSetter__().hello()); | 13 Expect.equals(42, new __lookupSetter__().hello()); |
14 Expect.equals(42, new constructor().hello()); | 14 Expect.equals(42, new constructor().hello()); |
15 Expect.equals(42, new hasOwnProperty().hello()); | 15 Expect.equals(42, new hasOwnProperty().hello()); |
16 Expect.equals(42, new isPrototypeOf().hello()); | 16 Expect.equals(42, new isPrototypeOf().hello()); |
17 Expect.equals(42, new propertyIsEnumerable().hello()); | 17 Expect.equals(42, new propertyIsEnumerable().hello()); |
18 Expect.equals(42, new toLocaleString().hello()); | 18 Expect.equals(42, new toLocaleString().hello()); |
19 Expect.equals(42, new toString().hello()); | 19 Expect.equals(42, new toString().hello()); |
20 Expect.equals(42, new valueOf().hello()); | 20 Expect.equals(42, new valueOf().hello()); |
21 } | 21 } |
22 | 22 |
23 class Hello { | 23 class Hello { |
24 int hello() => 42; | 24 int hello() => 42; |
25 } | 25 } |
26 | 26 |
27 class __defineGetter__ extends Hello {} | 27 class __defineGetter__ extends Hello {} |
| 28 |
28 class __defineSetter__ extends Hello {} | 29 class __defineSetter__ extends Hello {} |
| 30 |
29 class __lookupGetter__ extends Hello {} | 31 class __lookupGetter__ extends Hello {} |
| 32 |
30 class __lookupSetter__ extends Hello {} | 33 class __lookupSetter__ extends Hello {} |
| 34 |
31 class constructor extends Hello {} | 35 class constructor extends Hello {} |
| 36 |
32 class hasOwnProperty extends Hello {} | 37 class hasOwnProperty extends Hello {} |
| 38 |
33 class isPrototypeOf extends Hello {} | 39 class isPrototypeOf extends Hello {} |
| 40 |
34 class propertyIsEnumerable extends Hello {} | 41 class propertyIsEnumerable extends Hello {} |
| 42 |
35 class toLocaleString extends Hello {} | 43 class toLocaleString extends Hello {} |
| 44 |
36 class toString extends Hello {} | 45 class toString extends Hello {} |
| 46 |
37 class valueOf extends Hello {} | 47 class valueOf extends Hello {} |
OLD | NEW |