| Index: pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
|
| diff --git a/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart b/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
|
| index d5970c5360ada8b5c3a521d00cb72d7aec3148bd..0bcc9df4e7306a36a7030bf8a3cf8678404b6d31 100644
|
| --- a/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
|
| +++ b/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
|
| @@ -293,6 +293,21 @@ class UnsugarVisitor extends RecursiveVisitor {
|
| // TODO(karlklose): implement the checked mode part of boolean conversion.
|
| InteriorNode parent = node.parent;
|
| IsTrue condition = node.condition;
|
| +
|
| + // Do not rewrite conditions that are foreign code.
|
| + // It is redundant, and causes infinite recursion (if not optimized)
|
| + // in the implementation of identical, which itself contains a condition.
|
| + Primitive value = condition.value.definition;
|
| + if (value is Parameter && value.parent is Continuation) {
|
| + Continuation cont = value.parent;
|
| + if (cont.hasExactlyOneUse && cont.firstRef.parent is ForeignCode) {
|
| + ForeignCode foreign = cont.firstRef.parent;
|
| + if (foreign.type.containsOnlyBool(_glue.classWorld)) {
|
| + return;
|
| + }
|
| + }
|
| + }
|
| +
|
| Primitive t = trueConstant;
|
| Primitive i = new ApplyBuiltinOperator(
|
| BuiltinOperator.Identical,
|
|
|