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 | 4 |
5 /** | 5 /** |
6 * Everything in Dart is an [Object]. | 6 * Everything in Dart is an [Object]. |
7 */ | 7 */ |
8 class Object { | 8 class Object { |
9 /** | 9 /** |
10 * Creates a new [Object] instance. | 10 * Creates a new [Object] instance. |
(...skipping 20 matching lines...) Expand all Loading... |
31 * | 31 * |
32 * All objects have hash codes. Hash codes are guaranteed to be the | 32 * All objects have hash codes. Hash codes are guaranteed to be the |
33 * same for objects that are equal when compared using the equality | 33 * same for objects that are equal when compared using the equality |
34 * operator [:==:]. Other than that there are no guarantees about | 34 * operator [:==:]. Other than that there are no guarantees about |
35 * the hash codes. They will not be consistent between runs and | 35 * the hash codes. They will not be consistent between runs and |
36 * there are no distribution guarantees. | 36 * there are no distribution guarantees. |
37 * | 37 * |
38 * If a subclass overrides [hashCode] it should override the | 38 * If a subclass overrides [hashCode] it should override the |
39 * equality operator as well to maintain consistency. | 39 * equality operator as well to maintain consistency. |
40 */ | 40 */ |
41 external int hashCode(); | 41 external int get hashCode; |
42 | 42 |
43 /** | 43 /** |
44 * Returns a string representation of this object. | 44 * Returns a string representation of this object. |
45 */ | 45 */ |
46 external String toString(); | 46 external String toString(); |
47 | 47 |
48 /** | 48 /** |
49 * [noSuchMethod] is invoked when users invoke a non-existant method | 49 * [noSuchMethod] is invoked when users invoke a non-existant method |
50 * on an object. The name of the method and the arguments of the | 50 * on an object. The name of the method and the arguments of the |
51 * invocation are passed to [noSuchMethod]. If [noSuchMethod] | 51 * invocation are passed to [noSuchMethod]. If [noSuchMethod] |
52 * returns a value, that value becomes the result of the original | 52 * returns a value, that value becomes the result of the original |
53 * invocation. | 53 * invocation. |
54 * | 54 * |
55 * The default behavior of [noSuchMethod] is to throw a | 55 * The default behavior of [noSuchMethod] is to throw a |
56 * [noSuchMethodError]. | 56 * [noSuchMethodError]. |
57 */ | 57 */ |
58 external Dynamic noSuchMethod(String name, List args); | 58 external Dynamic noSuchMethod(String name, List args); |
59 /** | 59 /** |
60 * A representation of the runtime type of the object. | 60 * A representation of the runtime type of the object. |
61 */ | 61 */ |
62 external Type get runtimeType; | 62 external Type get runtimeType; |
63 } | 63 } |
64 | 64 |
OLD | NEW |