| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 /// Contains the names of globals that are embedded into the output by the | 5 /// Contains the names of globals that are embedded into the output by the |
| 6 /// compiler. | 6 /// compiler. |
| 7 /// | 7 /// |
| 8 /// Variables embedded this way should be access with `JS_EMBEDDED_GLOBAL` from | 8 /// Variables embedded this way should be access with `JS_EMBEDDED_GLOBAL` from |
| 9 /// the `_foreign_helper` library. | 9 /// the `_foreign_helper` library. |
| 10 /// | 10 /// |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 enum JsBuiltin { | 98 enum JsBuiltin { |
| 99 /// Returns the JavaScript constructor function for Dart's Object class. | 99 /// Returns the JavaScript constructor function for Dart's Object class. |
| 100 /// This can be used for type tests, as in | 100 /// This can be used for type tests, as in |
| 101 /// | 101 /// |
| 102 /// var constructor = JS_BUILTIN('', JsBuiltin.dartObjectContructor); | 102 /// var constructor = JS_BUILTIN('', JsBuiltin.dartObjectContructor); |
| 103 /// if (JS('bool', '# instanceof #', obj, constructor)) | 103 /// if (JS('bool', '# instanceof #', obj, constructor)) |
| 104 /// ... | 104 /// ... |
| 105 dartObjectConstructor, | 105 dartObjectConstructor, |
| 106 | 106 |
| 107 /// Returns the class name given an [isCheckProperty]. | 107 /// Returns the JavaScript-constructor name given an [isCheckProperty]. |
| 108 /// | 108 /// |
| 109 /// This relies on a deterministic encoding of is-check properties (for | 109 /// This relies on a deterministic encoding of is-check properties (for |
| 110 /// example `$isFoo` for a class `Foo`). In minified code the returned | 110 /// example `$isFoo` for a class `Foo`). In minified code the returned |
| 111 /// classname is the minified name of the class. | 111 /// classname is the minified name of the class. |
| 112 /// | 112 /// |
| 113 /// JS_BUILTIN('returns:String;depends:none;effects:none', | 113 /// JS_BUILTIN('returns:String;depends:none;effects:none', |
| 114 /// JsBuiltin.classNameFromIsCheckProperty, | 114 /// JsBuiltin.isCheckPropertyToJsConstructorName, |
| 115 /// isCheckProperty); | 115 /// isCheckProperty); |
| 116 classNameFromIsCheckProperty, | 116 isCheckPropertyToJsConstructorName, |
| 117 | 117 |
| 118 /// Returns true if the given type is a function type. Returns false for | 118 /// Returns true if the given type is a function type. Returns false for |
| 119 /// the one `Function` type singleton. (See [isFunctionTypeSingleton]). | 119 /// the one `Function` type singleton. (See [isFunctionTypeSingleton]). |
| 120 /// | 120 /// |
| 121 /// JS_BUILTIN('bool', JsBuiltin.isFunctionType, o) | 121 /// JS_BUILTIN('bool', JsBuiltin.isFunctionType, o) |
| 122 isFunctionType, | 122 isFunctionType, |
| 123 | 123 |
| 124 /// Returns a new function type object. | 124 /// Returns a new function type object. |
| 125 /// | 125 /// |
| 126 /// JS_BUILTIN('=Object', JsBuiltin.createFunctionType) | 126 /// JS_BUILTIN('=Object', JsBuiltin.createFunctionType) |
| 127 createFunctionType, | 127 createFunctionTypeRti, |
| 128 | 128 |
| 129 /// Returns the class name of the given type. | 129 /// Returns the JavaScript-constructor name given an rti encoding. |
| 130 /// | 130 /// |
| 131 /// JS_BUILTIN('String', JsBuiltin.typeName, type) | 131 /// JS_BUILTIN('String', JsBuiltin.rawRtiToJsConstructorName, rti) |
| 132 typeName, | 132 rawRtiToJsConstructorName, |
| 133 | 133 |
| 134 /// Returns the raw runtime type of the given object. The given argument | 134 /// Returns the raw runtime type of the given object. The given argument |
| 135 /// [o] should be the interceptor (for non-Dart objects). | 135 /// [o] should be the interceptor (for non-Dart objects). |
| 136 /// | 136 /// |
| 137 /// JS_BUILTIN('', JsBuiltin.rawRuntimeType, o) | 137 /// JS_BUILTIN('', JsBuiltin.rawRuntimeType, o) |
| 138 rawRuntimeType, | 138 rawRuntimeType, |
| 139 | 139 |
| 140 /// Returns whether the given type is a subtype of other. | 140 /// Returns whether the given type is a subtype of other. |
| 141 /// | 141 /// |
| 142 /// The argument `other` is the name of the potential supertype. It is | 142 /// The argument `other` is the name of the potential supertype. It is |
| (...skipping 30 matching lines...) Expand all Loading... |
| 173 /// JS_BUILTIN('returns:var;effects:none;depends:none', | 173 /// JS_BUILTIN('returns:var;effects:none;depends:none', |
| 174 /// JsBuiltin.getMetadata, index); | 174 /// JsBuiltin.getMetadata, index); |
| 175 getMetadata, | 175 getMetadata, |
| 176 | 176 |
| 177 /// Returns the type of the given [index]. | 177 /// Returns the type of the given [index]. |
| 178 /// | 178 /// |
| 179 /// JS_BUILTIN('returns:var;effects:none;depends:none', | 179 /// JS_BUILTIN('returns:var;effects:none;depends:none', |
| 180 /// JsBuiltin.getType, index); | 180 /// JsBuiltin.getType, index); |
| 181 getType, | 181 getType, |
| 182 } | 182 } |
| OLD | NEW |