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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 48383003: Support checking of malbounded types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 7 years, 2 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/compiler/implementation/js_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 6bf50f821904696df098197feb0f32c52f4a1eb3..24c982d6a618b64b0b511090ae059d24fa9d7ecf 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -1077,6 +1077,16 @@ class JavaScriptBackend extends Backend {
enqueueClass(compiler.enqueuer.resolution, compiler.stringClass, elements);
}
+ void registerTypeVariableBoundsSubtypeCheck(DartType typeArgument,
+ DartType bound) {
+ rti.registerTypeVariableBoundsSubtypeCheck(typeArgument, bound);
+ }
+
+ void registerTypeVariableBoundCheck(TreeElements elements) {
+ enqueueInResolution(getThrowTypeError(), elements);
+ enqueueInResolution(getAssertIsSubtype(), elements);
+ }
+
void registerAbstractClassInstantiation(TreeElements elements) {
enqueueInResolution(getThrowAbstractClassInstantiationError(), elements);
// Also register the types of the arguments passed to this method.
@@ -1482,6 +1492,10 @@ class JavaScriptBackend extends Backend {
return compiler.findHelper('throwRuntimeError');
}
+ Element getThrowTypeError() {
+ return compiler.findHelper('throwTypeError');
+ }
+
Element getThrowAbstractClassInstantiationError() {
return compiler.findHelper('throwAbstractClassInstantiationError');
}
@@ -1534,6 +1548,10 @@ class JavaScriptBackend extends Backend {
return compiler.findHelper('runtimeTypeToString');
}
+ Element getAssertIsSubtype() {
+ return compiler.findHelper('assertIsSubtype');
+ }
+
Element getCheckSubtype() {
return compiler.findHelper('checkSubtype');
}

Powered by Google App Engine
This is Rietveld 408576698