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

Unified Diff: tool/input_sdk/private/ddc_runtime/types.dart

Issue 2061373003: implement user-defined nSM, Object members on functions (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: fix Created 4 years, 6 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: tool/input_sdk/private/ddc_runtime/types.dart
diff --git a/tool/input_sdk/private/ddc_runtime/types.dart b/tool/input_sdk/private/ddc_runtime/types.dart
index 3ed88b844560dfadb29f8175ab80618762d39c1a..d194ef3f9b428cccfe3dff937fd632464bbc3852 100644
--- a/tool/input_sdk/private/ddc_runtime/types.dart
+++ b/tool/input_sdk/private/ddc_runtime/types.dart
@@ -53,9 +53,8 @@ final _typeObject = JS('', 'Symbol("typeObject")');
/// name 'is_X', 'as_X' and 'check_X' for various X to indicate the type or the
/// implementation strategy for the test (e.g 'is_String', 'is_G' for generic
/// types, etc.)
-
-/// TODO(sra): Why implement [Type]? Other types that are represented by class
-/// constructors can't implement [Type].
+// TODO(jmesserly): we shouldn't implement Type here. It should be moved down
+// to AbstractFunctionType.
class TypeRep implements Type {
TypeRep() { _initialize; }
String get name => this.toString();
@@ -112,12 +111,10 @@ class JSObject extends TypeRep {
final jsobject = new JSObject();
-// TODO(sra): Wrapped types and TypeReps are incompatible. TypeRep should not
-// implement Type and WrappedType should implement Type but not TypeRep.
-class WrappedType extends TypeRep {
- final _runtimeType;
- WrappedType(this._runtimeType);
- toString() => typeName(_runtimeType);
+class WrappedType extends Type {
+ final _wrappedType;
+ WrappedType(this._wrappedType);
+ toString() => typeName(_wrappedType);
}
final AbstractFunctionType = JS('', '''
@@ -430,8 +427,6 @@ definiteFunctionType(returnType, args, extra) =>
typedef(name, closure) => JS('', 'new #(#, #)', Typedef, name, closure);
-bool isDartType(type) => JS('bool', '#(#) === #', _getRuntimeType, type, Type);
-
typeName(type) => JS('', '''(() => {
if ($type === void 0) return "undefined type";
if ($type === null) return "null type";

Powered by Google App Engine
This is Rietveld 408576698