Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: pkg/compiler/lib/src/js_emitter/lazy_emitter/emitter.dart

Issue 1421003004: Add CoreClasses (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698