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

Unified Diff: sdk/lib/_internal/compiler/js_lib/js_rti.dart

Issue 826413003: Use a shared function to represent type substitutions with dynamic. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: comments Created 5 years, 11 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/js_lib/js_rti.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/js_rti.dart b/sdk/lib/_internal/compiler/js_lib/js_rti.dart
index 08c52dd960e7d83d819a8576b981035b8a8cf6e8..70bb241fe6e06daf6efff127370d0a0b986e00d1 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_rti.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_rti.dart
@@ -37,7 +37,8 @@
* subtype check, if the type arguments to be used in the check do not
* depend on the type arguments of the object.
* 3) A function mapping the type variables of the object to be checked to
- * a list expression.
+ * a list expression. The function may also return null, which is equivalent
karlklose 2015/01/20 10:37:32 "null" -> "`null`".
+ * to an array containing only null values.
*/
part of _js_helper;
@@ -236,7 +237,7 @@ substitute(var substitution, var arguments) {
assert(arguments == null || isJsArray(arguments));
if (isJsFunction(substitution)) {
substitution = invoke(substitution, arguments);
- if (isJsArray(substitution)) {
+ if (substitution == null || isJsArray(substitution)) {
arguments = substitution;
} else if (isJsFunction(substitution)) {
// TODO(johnniwinther): Check if this is still needed.

Powered by Google App Engine
This is Rietveld 408576698