Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: test/generated_sdk/lib/core/object.dart

Issue 1162723007: remove generated_sdk from checked in code (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/generated_sdk/lib/core/num.dart ('k') | test/generated_sdk/lib/core/pattern.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 part of dart.core;
6
7 /**
8 * The base class for all Dart objects.
9 *
10 * Because Object is the root of the Dart class hierarchy,
11 * every other Dart class is a subclass of Object.
12 *
13 * When you define a class, you should override [toString]
14 * to return a string describing an instance of that class.
15 * You might also need to define [hashCode] and [==], as described in the
16 * [Implementing map keys]
17 * (http://www.dartlang.org/docs/dart-up-and-running/contents/ch03.html#ch03-imp lementing-map-keys)
18 * section of the [library tour]
19 * (http://www.dartlang.org/docs/dart-up-and-running/contents/ch03.html).
20 */
21 class Object {
22 /**
23 * Creates a new [Object] instance.
24 *
25 * [Object] instances have no meaningful state, and are only useful
26 * through their identity. An [Object] instance is equal to itself
27 * only.
28 */
29 const Object();
30
31 /**
32 * The equality operator.
33 *
34 * The default behavior for all [Object]s is to return true if and
35 * only if [:this:] and [other] are the same object.
36 *
37 * Override this method to specify a different equality relation on
38 * a class. The overriding method must still be an equivalence relation.
39 * That is, it must be:
40 *
41 * * Total: It must return a boolean for all arguments. It should never throw
42 * or return `null`.
43 *
44 * * Reflexive: For all objects `o`, `o == o` must be true.
45 *
46 * * Symmetric: For all objects `o1` and `o2`, `o1 == o2` and `o2 == o1` must
47 * either both be true, or both be false.
48 *
49 * * Transitive: For all objects `o1`, `o2`, and `o3`, if `o1 == o2` and
50 * `o2 == o3` are true, then `o1 == o3` must be true.
51 *
52 * The method should also be consistent over time, so equality of two objects
53 * should not change over time, or at least only change if one of the objects
54 * was modified.
55 *
56 * If a subclass overrides the equality operator it should override
57 * the [hashCode] method as well to maintain consistency.
58 */
59 bool operator ==(other) => identical(this, other);
60
61 /**
62 * Get a hash code for this object.
63 *
64 * All objects have hash codes. Hash codes are guaranteed to be the
65 * same for objects that are equal when compared using the equality
66 * operator [:==:]. Other than that there are no guarantees about
67 * the hash codes. They will not be consistent between runs and
68 * there are no distribution guarantees.
69 *
70 * If a subclass overrides [hashCode] it should override the
71 * equality operator as well to maintain consistency.
72 */
73 int get hashCode => Primitives.objectHashCode(this);
74
75 /**
76 * Returns a string representation of this object.
77 */
78 String toString() => Primitives.objectToString(this);
79
80 /**
81 * [noSuchMethod] is invoked when users invoke a non-existent method
82 * on an object. The name of the method and the arguments of the
83 * invocation are passed to [noSuchMethod] in an [Invocation].
84 * If [noSuchMethod] returns a value, that value becomes the result of
85 * the original invocation.
86 *
87 * The default behavior of [noSuchMethod] is to throw a
88 * [NoSuchMethodError].
89 */
90 dynamic noSuchMethod(Invocation invocation) {
91 throw new NoSuchMethodError(
92 this,
93 invocation.memberName,
94 invocation.positionalArguments,
95 invocation.namedArguments);
96 }
97
98 /**
99 * A representation of the runtime type of the object.
100 */
101 Type get runtimeType => JS('Type', 'dart.realRuntimeType(#)', this);
102 }
OLDNEW
« no previous file with comments | « test/generated_sdk/lib/core/num.dart ('k') | test/generated_sdk/lib/core/pattern.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698