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

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

Issue 2595493002: Merge CoreTypes and CoreClasses into CommonElements. (Closed)
Patch Set: Updated cf. comment Created 4 years 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 JsBuiltin; 7 import 'package:js_runtime/shared/embedded_names.dart' show JsBuiltin;
8 8
9 import '../../common.dart'; 9 import '../../common.dart';
10 import '../../compiler.dart' show Compiler; 10 import '../../compiler.dart' show Compiler;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 return js.js('#.ensureResolved()', _globalPropertyAccess(element)); 137 return js.js('#.ensureResolved()', _globalPropertyAccess(element));
138 } 138 }
139 139
140 @override 140 @override
141 js.Template templateForBuiltin(JsBuiltin builtin) { 141 js.Template templateForBuiltin(JsBuiltin builtin) {
142 String typeNameProperty = ModelEmitter.typeNameProperty; 142 String typeNameProperty = ModelEmitter.typeNameProperty;
143 143
144 switch (builtin) { 144 switch (builtin) {
145 case JsBuiltin.dartObjectConstructor: 145 case JsBuiltin.dartObjectConstructor:
146 return js.js.expressionTemplateYielding( 146 return js.js.expressionTemplateYielding(
147 typeAccess(_compiler.coreClasses.objectClass)); 147 typeAccess(_compiler.commonElements.objectClass));
148 148
149 case JsBuiltin.isCheckPropertyToJsConstructorName: 149 case JsBuiltin.isCheckPropertyToJsConstructorName:
150 int isPrefixLength = namer.operatorIsPrefix.length; 150 int isPrefixLength = namer.operatorIsPrefix.length;
151 return js.js.expressionTemplateFor('#.substring($isPrefixLength)'); 151 return js.js.expressionTemplateFor('#.substring($isPrefixLength)');
152 152
153 case JsBuiltin.isFunctionType: 153 case JsBuiltin.isFunctionType:
154 return _backend.rtiEncoder.templateForIsFunctionType; 154 return _backend.rtiEncoder.templateForIsFunctionType;
155 155
156 case JsBuiltin.rawRtiToJsConstructorName: 156 case JsBuiltin.rawRtiToJsConstructorName:
157 return js.js.expressionTemplateFor("#.$typeNameProperty"); 157 return js.js.expressionTemplateFor("#.$typeNameProperty");
(...skipping 25 matching lines...) Expand all
183 default: 183 default:
184 reporter.internalError( 184 reporter.internalError(
185 NO_LOCATION_SPANNABLE, "Unhandled Builtin: $builtin"); 185 NO_LOCATION_SPANNABLE, "Unhandled Builtin: $builtin");
186 return null; 186 return null;
187 } 187 }
188 } 188 }
189 189
190 @override 190 @override
191 void invalidateCaches() {} 191 void invalidateCaches() {}
192 } 192 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/js_emitter.dart ('k') | pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698