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

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

Issue 1121313007: dart2js: add builtin 'isSubtype'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 months 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 | Annotate | Revision Log
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.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 9
10 import '../program_builder.dart' show ProgramBuilder; 10 import '../program_builder.dart' show ProgramBuilder;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 case JsBuiltin.typeName: 155 case JsBuiltin.typeName:
156 return js.js.expressionTemplateFor("#.$typeNameProperty"); 156 return js.js.expressionTemplateFor("#.$typeNameProperty");
157 157
158 case JsBuiltin.rawRuntimeType: 158 case JsBuiltin.rawRuntimeType:
159 return js.js.expressionTemplateFor("#.constructor"); 159 return js.js.expressionTemplateFor("#.constructor");
160 160
161 case JsBuiltin.createFunctionType: 161 case JsBuiltin.createFunctionType:
162 return _backend.rti.representationGenerator 162 return _backend.rti.representationGenerator
163 .templateForCreateFunctionType; 163 .templateForCreateFunctionType;
164 164
165 case JsBuiltin.isSubtype:
166 // TODO(floitsch): move this closer to where is-check properties are
167 // built.
168 String isPrefix = namer.operatorIsPrefix;
169 return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype");
170
165 default: 171 default:
166 _compiler.internalError(NO_LOCATION_SPANNABLE, 172 _compiler.internalError(NO_LOCATION_SPANNABLE,
167 "Unhandled Builtin: $builtin"); 173 "Unhandled Builtin: $builtin");
168 return null; 174 return null;
169 } 175 }
170 } 176 }
171 177
172 @override 178 @override
173 void invalidateCaches() { 179 void invalidateCaches() {
174 } 180 }
175 } 181 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart ('k') | pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698