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 library dart2js.new_js_emitter.emitter; | 5 library dart2js.new_js_emitter.emitter; |
6 | 6 |
7 import 'package:_internal/compiler/js_lib/shared/embedded_names.dart' show | 7 import 'package:_internal/compiler/js_lib/shared/embedded_names.dart' show |
8 JsBuiltin; | 8 JsBuiltin; |
9 | 9 |
10 import '../program_builder.dart' show ProgramBuilder; | 10 import '../program_builder.dart' show ProgramBuilder; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 case JsBuiltin.typeName: | 155 case JsBuiltin.typeName: |
156 return js.js.expressionTemplateFor("#.$typeNameProperty"); | 156 return js.js.expressionTemplateFor("#.$typeNameProperty"); |
157 | 157 |
158 case JsBuiltin.rawRuntimeType: | 158 case JsBuiltin.rawRuntimeType: |
159 return js.js.expressionTemplateFor("#.constructor"); | 159 return js.js.expressionTemplateFor("#.constructor"); |
160 | 160 |
161 case JsBuiltin.createFunctionType: | 161 case JsBuiltin.createFunctionType: |
162 return _backend.rti.representationGenerator | 162 return _backend.rti.representationGenerator |
163 .templateForCreateFunctionType; | 163 .templateForCreateFunctionType; |
164 | 164 |
| 165 case JsBuiltin.isSubtype: |
| 166 // TODO(floitsch): move this closer to where is-check properties are |
| 167 // built. |
| 168 String isPrefix = namer.operatorIsPrefix; |
| 169 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype"); |
| 170 |
165 default: | 171 default: |
166 _compiler.internalError(NO_LOCATION_SPANNABLE, | 172 _compiler.internalError(NO_LOCATION_SPANNABLE, |
167 "Unhandled Builtin: $builtin"); | 173 "Unhandled Builtin: $builtin"); |
168 return null; | 174 return null; |
169 } | 175 } |
170 } | 176 } |
171 | 177 |
172 @override | 178 @override |
173 void invalidateCaches() { | 179 void invalidateCaches() { |
174 } | 180 } |
175 } | 181 } |
OLD | NEW |