| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // The following methods are used to handle type information | 5 // The following methods are used to handle type information |
| 6 // | 6 // |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * @constructor | 9 * @constructor |
| 10 * @param {string} classkey | 10 * @param {string} classkey |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 this.implementedTypes[classkey] = this; | 26 this.implementedTypes[classkey] = this; |
| 27 // Add Object | 27 // Add Object |
| 28 if (!functionType && classkey != $cls('Object')) { | 28 if (!functionType && classkey != $cls('Object')) { |
| 29 this.implementedTypes[$cls('Object')] = RTT.objectType; | 29 this.implementedTypes[$cls('Object')] = RTT.objectType; |
| 30 } | 30 } |
| 31 } | 31 } |
| 32 | 32 |
| 33 /** @type {Object.<string, Object>} */ | 33 /** @type {Object.<string, Object>} */ |
| 34 RTT.types = {}; | 34 RTT.types = {}; |
| 35 | 35 |
| 36 /** @type {Array.<RTT>} */ | |
| 37 RTT.prototype.derivedTypes = []; | |
| 38 | |
| 39 /** @return {string} */ | 36 /** @return {string} */ |
| 40 RTT.prototype.toString = function() { return this.typeKey; } | 37 RTT.prototype.toString = function() { return this.typeKey; } |
| 41 | 38 |
| 42 /** | 39 /** |
| 43 * @param {*} value | 40 * @param {*} value |
| 44 * @return {boolean} Whether this type is implemented by the value | 41 * @return {boolean} Whether this type is implemented by the value |
| 45 */ | 42 */ |
| 46 RTT.prototype.implementedBy = function(value){ | 43 RTT.prototype.implementedBy = function(value){ |
| 47 return (value == null) ? RTT.nullInstanceOf(this) : | 44 return (value == null) ? RTT.nullInstanceOf(this) : |
| 48 this.functionType ? this.implementedByTypeFunc(value) : | 45 this.functionType ? this.implementedByTypeFunc(value) : |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 return typeof o == 'number'; | 432 return typeof o == 'number'; |
| 436 } | 433 } |
| 437 | 434 |
| 438 /** | 435 /** |
| 439 * @param {*} o | 436 * @param {*} o |
| 440 * @return {boolean} | 437 * @return {boolean} |
| 441 */ | 438 */ |
| 442 function $isString(o) { | 439 function $isString(o) { |
| 443 return typeof o == 'string'; | 440 return typeof o == 'string'; |
| 444 } | 441 } |
| OLD | NEW |