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

Unified Diff: sdk/lib/_internal/js_runtime/lib/js_rti.dart

Issue 1385423002: dart2js cps_ir: Use interceptors for is-checks (version 2) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: fix analyzer warnings Created 5 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
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/js_rti.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/js_rti.dart b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
index 60af58d2331934fe80ff2803951787b68ab29902..65ae2576c9ee0b882bfd868eeb21c4371b3ebbf0 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_rti.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
@@ -237,11 +237,17 @@ substitute(var substitution, var arguments) {
assert(arguments == null || isJsArray(arguments));
if (isJsFunction(substitution)) {
substitution = invoke(substitution, arguments);
- if (substitution == null || isJsArray(substitution)) {
- arguments = substitution;
- } else if (isJsFunction(substitution)) {
+ if (substitution == null) return substitution;
+ if (isJsArray(substitution)) {
+ // Substitutions are generated too late to mark Array as used, so use a
+ // tautological JS 'cast' to mark Array as used. This is needed only in
+ // some tiny tests where the substition is the only thing that creates an
+ // Array.
+ return JS('JSArray', '#', substitution);
+ }
+ if (isJsFunction(substitution)) {
// TODO(johnniwinther): Check if this is still needed.
- arguments = invoke(substitution, arguments);
+ return invoke(substitution, arguments);
}
}
return arguments;
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698