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

Unified Diff: lib/runtime/dart_core.js

Issue 1016003003: sort classes in dependency order, or load lazily if needed, fixes #78 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/runtime/dart_runtime.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart_core.js
diff --git a/lib/runtime/dart_core.js b/lib/runtime/dart_core.js
index 12084b86f260c5762cd0055f746344d2a353605a..ce3402050cc386fcfc26815e220f2f968859896b 100644
--- a/lib/runtime/dart_core.js
+++ b/lib/runtime/dart_core.js
@@ -2,35 +2,49 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-var dart_core;
-(function (dart_core) {
- var Object = (function () {
- var constructor = function Object() {};
+var core;
+(function (core) {
+ 'use strict';
- constructor.prototype.toString = function toString() {
- return 'Instance of ' + this.constructor.name;
- };
-
- constructor.prototype.noSuchMethod = function noSuchMethod(invocation) {
- // TODO: add arguments when Invocation is defined
- throw new NoSuchMethodError();
- };
-
- // TODO: implement ==
-
- // TODO: implement hashCode
-
- // TODO: implement runtimeType
+ // TODO(jmesserly): for now this is copy+paste from dart/core.js
+ class Object {
+ constructor() {
+ var name = this.constructor.name;
+ var init = this[name];
+ var result = void 0;
+ if (init)
+ result = init.apply(this, arguments);
+ return result === void 0 ? this : result;
+ }
+ ['=='](other) {
+ return identical(this, other);
+ }
+ get hashCode() {
+ return _js_helper.Primitives.objectHashCode(this);
+ }
+ toString() {
+ return _js_helper.Primitives.objectToString(this);
+ }
+ noSuchMethod(invocation) {
+ throw new NoSuchMethodError(this, invocation.memberName, invocation.positionalArguments, invocation.namedArguments);
+ }
+ get runtimeType() {
+ return _js_helper.getRuntimeType(this);
+ }
+ }
+ core.Object = Object;
- return constructor;
- })();
- dart_core.Object = Object;
+ // Function identical: (Object, Object) → bool
+ function identical(a, b) {
+ return _js_helper.Primitives.identicalImplementation(a, b);
+ }
+ core.identical = identical;
// Function print: (Object) → void
function print(obj) {
console.log(obj.toString());
}
- dart_core.print = print;
+ core.print = print;
// Class NoSuchMethodError
var NoSuchMethodError = (function () {
@@ -39,7 +53,7 @@ var dart_core;
}
return NoSuchMethodError;
})();
- dart_core.NoSuchMethodError = NoSuchMethodError;
+ core.NoSuchMethodError = NoSuchMethodError;
// Class UnimplementedError
var UnimplementedError = (function () {
@@ -49,5 +63,5 @@ var dart_core;
}
return UnimplementedError;
})();
- dart_core.UnimplementedError = UnimplementedError;
-})(dart_core || (dart_core = {}));
+ core.UnimplementedError = UnimplementedError;
+})(core || (core = {}));
« no previous file with comments | « no previous file | lib/runtime/dart_runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698