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

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: Move more foreigns to builtins. 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 349905aeaad67b8ec99d4e83f90d705aac0f3381..3d5259b8eae779c8e49f9882620b62c1b613f499 100644
--- a/pkg/compiler/lib/src/js_backend/runtime_types.dart
+++ b/pkg/compiler/lib/src/js_backend/runtime_types.dart
@@ -673,6 +673,21 @@ class TypeRepresentationGenerator extends 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>[];

Powered by Google App Engine
This is Rietveld 408576698