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

Unified Diff: pkg/compiler/lib/src/js_backend/runtime_types.dart

Issue 954253002: dart2js: add compiler builtins to the core-runtime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix bad return type. (Also removes duplicate getInterceptor call). Created 5 years, 8 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_backend/runtime_types.dart
diff --git a/pkg/compiler/lib/src/js_backend/runtime_types.dart b/pkg/compiler/lib/src/js_backend/runtime_types.dart
index cd89c02d1578a487d31484401cd991f621b1a1ef..e14487fc3a36b13665ab1f83497fef4b3cf23228 100644
--- a/pkg/compiler/lib/src/js_backend/runtime_types.dart
+++ b/pkg/compiler/lib/src/js_backend/runtime_types.dart
@@ -672,6 +672,21 @@ class TypeRepresentationGenerator implements DartTypeVisitor {
return new jsAst.ArrayInitializer(elements);
}
+ /// Returns the JavaScript template to determine at runtime if a type object
+ /// is a function type.
+ jsAst.Template get templateForIsFunctionType {
+ return jsAst.js.expressionTemplateFor("'${namer.functionTypeTag}' in #");
+ }
+
+ /// Returns the JavaScript template that creates at runtime a new function
+ /// type object.
+ jsAst.Template get templateForCreateFunctionType {
+ // The value of the functionTypeTag can be anything. We use "dynaFunc" for
+ // easier debugging.
+ return jsAst.js.expressionTemplateFor(
+ '{ ${namer.functionTypeTag}: "dynafunc" }');
+ }
+
visitFunctionType(FunctionType type, _) {
List<jsAst.Property> properties = <jsAst.Property>[];
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_emitter/code_emitter_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698