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 METADATA, | 9 METADATA, |
10 TYPES; | 10 TYPES; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // built. | 169 // built. |
170 String isPrefix = namer.operatorIsPrefix; | 170 String isPrefix = namer.operatorIsPrefix; |
171 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype"); | 171 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype"); |
172 | 172 |
173 case JsBuiltin.getMetadata: | 173 case JsBuiltin.getMetadata: |
174 String metadataAccess = | 174 String metadataAccess = |
175 _emitter.generateEmbeddedGlobalAccessString(METADATA); | 175 _emitter.generateEmbeddedGlobalAccessString(METADATA); |
176 return js.js.expressionTemplateFor("$metadataAccess[#]"); | 176 return js.js.expressionTemplateFor("$metadataAccess[#]"); |
177 | 177 |
178 case JsBuiltin.getType: | 178 case JsBuiltin.getType: |
179 String typesAccess = _emitter.generateEmbeddedGlobalAccessString(TYPES); | 179 return _emitter.templateForReadType; |
180 return js.js.expressionTemplateFor("$typesAccess[#]"); | |
181 | 180 |
182 default: | 181 default: |
183 _compiler.internalError(NO_LOCATION_SPANNABLE, | 182 _compiler.internalError(NO_LOCATION_SPANNABLE, |
184 "Unhandled Builtin: $builtin"); | 183 "Unhandled Builtin: $builtin"); |
185 return null; | 184 return null; |
186 } | 185 } |
187 } | 186 } |
188 | 187 |
189 @override | 188 @override |
190 void invalidateCaches() { | 189 void invalidateCaches() { |
191 } | 190 } |
192 } | 191 } |
OLD | NEW |