| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2015, 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 var core; | |
| 6 (function (core) { | |
| 7 'use strict'; | |
| 8 | |
| 9 // TODO(jmesserly): for now this is copy+paste from dart/core.js | |
| 10 class Object { | |
| 11 constructor() { | |
| 12 var name = this.constructor.name; | |
| 13 var init = this[name]; | |
| 14 var result = void 0; | |
| 15 if (init) | |
| 16 result = init.apply(this, arguments); | |
| 17 return result === void 0 ? this : result; | |
| 18 } | |
| 19 ['=='](other) { | |
| 20 return identical(this, other); | |
| 21 } | |
| 22 get hashCode() { | |
| 23 return _js_helper.Primitives.objectHashCode(this); | |
| 24 } | |
| 25 toString() { | |
| 26 return _js_helper.Primitives.objectToString(this); | |
| 27 } | |
| 28 noSuchMethod(invocation) { | |
| 29 throw new NoSuchMethodError(this, invocation.memberName, invocation.positi
onalArguments, invocation.namedArguments); | |
| 30 } | |
| 31 get runtimeType() { | |
| 32 return _js_helper.getRuntimeType(this); | |
| 33 } | |
| 34 } | |
| 35 core.Object = Object; | |
| 36 | |
| 37 // Function identical: (Object, Object) → bool | |
| 38 function identical(a, b) { | |
| 39 return _js_helper.Primitives.identicalImplementation(a, b); | |
| 40 } | |
| 41 core.identical = identical; | |
| 42 | |
| 43 // Function print: (Object) → void | |
| 44 function print(obj) { | |
| 45 console.log(obj.toString()); | |
| 46 } | |
| 47 core.print = print; | |
| 48 | |
| 49 // Class NoSuchMethodError | |
| 50 var NoSuchMethodError = (function () { | |
| 51 // TODO(vsm): Implement. | |
| 52 function NoSuchMethodError(f, args) { | |
| 53 } | |
| 54 return NoSuchMethodError; | |
| 55 })(); | |
| 56 core.NoSuchMethodError = NoSuchMethodError; | |
| 57 | |
| 58 // Class UnimplementedError | |
| 59 var UnimplementedError = (function () { | |
| 60 // TODO(vsm): Implement. | |
| 61 function UnimplementedError(message) { | |
| 62 this.message = (message != void 0) ? message : null; | |
| 63 } | |
| 64 return UnimplementedError; | |
| 65 })(); | |
| 66 core.UnimplementedError = UnimplementedError; | |
| 67 })(core || (core = {})); | |
| OLD | NEW |