| Index: pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| diff --git a/pkg/compiler/lib/src/cps_ir/type_propagation.dart b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| index b36440e9228c887e26776414047c4743c48bd975..1da858fc2335174ca61df1af924a97be16a1c185 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
|
| @@ -3020,7 +3020,21 @@ class TypePropagationVisitor implements Visitor {
|
|
|
| @override
|
| void visitForeignCode(ForeignCode node) {
|
| + bool firstArgumentIsNullable = false;
|
| + if (node.arguments.length > 0) {
|
| + AbstractConstantValue first = getValue(node.arguments.first.definition);
|
| + if (first.isNothing) {
|
| + setValue(node, nothing);
|
| + return;
|
| + }
|
| + firstArgumentIsNullable = first.isNullable;
|
| + }
|
| setValue(node, nonConstant(node.storedType));
|
| + node.isSafeForElimination =
|
| + !node.nativeBehavior.sideEffects.hasSideEffects() &&
|
| + (!node.nativeBehavior.throwBehavior.canThrow ||
|
| + (!firstArgumentIsNullable &&
|
| + node.nativeBehavior.throwBehavior.isOnlyNullNSMGuard));
|
| }
|
|
|
| @override
|
|
|