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

Unified Diff: sdk/lib/_internal/lib/js_helper.dart

Issue 21065002: Treat ambiguous types as malformed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Status updated. Created 7 years, 5 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: sdk/lib/_internal/lib/js_helper.dart
diff --git a/sdk/lib/_internal/lib/js_helper.dart b/sdk/lib/_internal/lib/js_helper.dart
index 5f590b0f5d3c98eddee37e259b93757ac570abbf..0efd6c2239ff37f11eb03cdb4dc5b7dfc852713f 100644
--- a/sdk/lib/_internal/lib/js_helper.dart
+++ b/sdk/lib/_internal/lib/js_helper.dart
@@ -802,14 +802,6 @@ throwRuntimeError(message) {
throw new RuntimeError(message);
}
-/**
- * The SSA builder generates a call to this method when a malformed type is used
- * in a subtype test.
- */
-throwMalformedSubtypeError(value, type, reasons) {
- throw new TypeErrorImplementation.malformedSubtype(value, type, reasons);
-}
-
throwAbstractClassInstantiationError(className) {
throw new AbstractClassInstantiationError(className);
}
@@ -1801,16 +1793,6 @@ voidTypeCheck(value) {
throw new TypeErrorImplementation(value, 'void');
}
-malformedTypeCheck(value, type, reasons) {
- if (value == null) return value;
- throwMalformedSubtypeError(value, type, reasons);
-}
-
-malformedTypeCast(value, type, reasons) {
- if (value == null) return value;
- throw new CastErrorImplementation.malformedTypeCast(value, type, reasons);
-}
-
/**
* Special interface recognized by the compiler and implemented by DOM
* objects that support integer indexing. This interface is not
@@ -1833,14 +1815,6 @@ class TypeErrorImplementation implements TypeError {
: message = "type '${Primitives.objectTypeName(value)}' is not a subtype "
"of type '$type'";
- /**
- * Type error caused by a subtype test on a malformed type.
- */
- TypeErrorImplementation.malformedSubtype(Object value,
- String type, String reasons)
- : message = "type '${Primitives.objectTypeName(value)}' is not a subtype "
- "of type '$type' because '$type' is malformed: $reasons.";
-
String toString() => message;
}
@@ -1856,17 +1830,6 @@ class CastErrorImplementation implements CastError {
: message = "CastError: Casting value of type $actualType to"
" incompatible type $expectedType";
-
- /**
- * Cast error caused by a type cast to a malformed type.
- */
- CastErrorImplementation.malformedTypeCast(Object value,
- String type, String reasons)
- : message = "CastError: Type '${Primitives.objectTypeName(value)}' "
- "cannot be cast to type '$type' because '$type' is "
- "malformed: $reasons.";
-
-
String toString() => message;
}

Powered by Google App Engine
This is Rietveld 408576698