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.js_emitter.lazy_emitter; | 5 library dart2js.js_emitter.lazy_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 TYPES; | 10 TYPES; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 return js.js('#.ensureResolved()', _globalPropertyAccess(element)); | 143 return js.js('#.ensureResolved()', _globalPropertyAccess(element)); |
144 } | 144 } |
145 | 145 |
146 @override | 146 @override |
147 js.Template templateForBuiltin(JsBuiltin builtin) { | 147 js.Template templateForBuiltin(JsBuiltin builtin) { |
148 String typeNameProperty = ModelEmitter.typeNameProperty; | 148 String typeNameProperty = ModelEmitter.typeNameProperty; |
149 | 149 |
150 switch (builtin) { | 150 switch (builtin) { |
151 case JsBuiltin.dartObjectConstructor: | 151 case JsBuiltin.dartObjectConstructor: |
152 return js.js.expressionTemplateYielding( | 152 return js.js.expressionTemplateYielding( |
153 typeAccess(_compiler.objectClass)); | 153 typeAccess(_compiler.coreClasses.objectClass)); |
154 | 154 |
155 case JsBuiltin.isCheckPropertyToJsConstructorName: | 155 case JsBuiltin.isCheckPropertyToJsConstructorName: |
156 int isPrefixLength = namer.operatorIsPrefix.length; | 156 int isPrefixLength = namer.operatorIsPrefix.length; |
157 return js.js.expressionTemplateFor('#.substring($isPrefixLength)'); | 157 return js.js.expressionTemplateFor('#.substring($isPrefixLength)'); |
158 | 158 |
159 case JsBuiltin.isFunctionType: | 159 case JsBuiltin.isFunctionType: |
160 return _backend.rtiEncoder.templateForIsFunctionType; | 160 return _backend.rtiEncoder.templateForIsFunctionType; |
161 | 161 |
162 case JsBuiltin.rawRtiToJsConstructorName: | 162 case JsBuiltin.rawRtiToJsConstructorName: |
163 return js.js.expressionTemplateFor("#.$typeNameProperty"); | 163 return js.js.expressionTemplateFor("#.$typeNameProperty"); |
(...skipping 26 matching lines...) Expand all Loading... |
190 reporter.internalError(NO_LOCATION_SPANNABLE, | 190 reporter.internalError(NO_LOCATION_SPANNABLE, |
191 "Unhandled Builtin: $builtin"); | 191 "Unhandled Builtin: $builtin"); |
192 return null; | 192 return null; |
193 } | 193 } |
194 } | 194 } |
195 | 195 |
196 @override | 196 @override |
197 void invalidateCaches() { | 197 void invalidateCaches() { |
198 } | 198 } |
199 } | 199 } |
OLD | NEW |