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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart
index a700946fb1617c01a6f1c25fb32a88a685ee9077..1e2dae36dd30550a0a21543043df06ae8b3db5d6 100644
--- a/pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart
@@ -162,6 +162,12 @@ class Emitter implements emitterTask.Emitter {
return _backend.rti.representationGenerator
.templateForCreateFunctionType;
+ case JsBuiltin.isSubtype:
+ // TODO(floitsch): move this closer to where is-check properties are
+ // built.
+ String isPrefix = namer.operatorIsPrefix;
+ return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype");
+
default:
_compiler.internalError(NO_LOCATION_SPANNABLE,
"Unhandled Builtin: $builtin");
« 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