OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 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 | 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.js_emitter.startup_emitter; | 5 library dart2js.js_emitter.startup_emitter; |
6 | 6 |
7 import 'package:js_runtime/shared/embedded_names.dart' show | 7 import 'package:js_runtime/shared/embedded_names.dart' show |
8 JsBuiltin, | 8 JsBuiltin, |
9 METADATA, | 9 METADATA, |
10 STATIC_FUNCTION_NAME_TO_CLOSURE, | 10 STATIC_FUNCTION_NAME_TO_CLOSURE, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 return _globalPropertyAccess(element); | 139 return _globalPropertyAccess(element); |
140 } | 140 } |
141 | 141 |
142 @override | 142 @override |
143 js.Template templateForBuiltin(JsBuiltin builtin) { | 143 js.Template templateForBuiltin(JsBuiltin builtin) { |
144 String typeNameProperty = ModelEmitter.typeNameProperty; | 144 String typeNameProperty = ModelEmitter.typeNameProperty; |
145 | 145 |
146 switch (builtin) { | 146 switch (builtin) { |
147 case JsBuiltin.dartObjectConstructor: | 147 case JsBuiltin.dartObjectConstructor: |
148 return js.js.expressionTemplateYielding( | 148 return js.js.expressionTemplateYielding( |
149 typeAccess(_compiler.objectClass)); | 149 typeAccess(_compiler.coreClasses.objectClass)); |
150 | 150 |
151 case JsBuiltin.isCheckPropertyToJsConstructorName: | 151 case JsBuiltin.isCheckPropertyToJsConstructorName: |
152 int isPrefixLength = namer.operatorIsPrefix.length; | 152 int isPrefixLength = namer.operatorIsPrefix.length; |
153 return js.js.expressionTemplateFor('#.substring($isPrefixLength)'); | 153 return js.js.expressionTemplateFor('#.substring($isPrefixLength)'); |
154 | 154 |
155 case JsBuiltin.isFunctionType: | 155 case JsBuiltin.isFunctionType: |
156 return _backend.rtiEncoder.templateForIsFunctionType; | 156 return _backend.rtiEncoder.templateForIsFunctionType; |
157 | 157 |
158 case JsBuiltin.rawRtiToJsConstructorName: | 158 case JsBuiltin.rawRtiToJsConstructorName: |
159 return js.js.expressionTemplateFor("#.$typeNameProperty"); | 159 return js.js.expressionTemplateFor("#.$typeNameProperty"); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 reporter.internalError(NO_LOCATION_SPANNABLE, | 192 reporter.internalError(NO_LOCATION_SPANNABLE, |
193 "Unhandled Builtin: $builtin"); | 193 "Unhandled Builtin: $builtin"); |
194 return null; | 194 return null; |
195 } | 195 } |
196 } | 196 } |
197 | 197 |
198 @override | 198 @override |
199 void invalidateCaches() { | 199 void invalidateCaches() { |
200 } | 200 } |
201 } | 201 } |
OLD | NEW |