Index: pkg/dev_compiler/lib/src/compiler/code_generator.dart |
diff --git a/pkg/dev_compiler/lib/src/compiler/code_generator.dart b/pkg/dev_compiler/lib/src/compiler/code_generator.dart |
index 6f2c2d1cd8dedcb5c0079afd775497b6c1cd194a..ac043391ee084b76d59d85547599100cd9b13607 100644 |
--- a/pkg/dev_compiler/lib/src/compiler/code_generator.dart |
+++ b/pkg/dev_compiler/lib/src/compiler/code_generator.dart |
@@ -3583,9 +3583,8 @@ class CodeGenerator extends Object |
if (_doubleEqIsIdentity(left, right)) { |
return _emitJSDoubleEq(args, negated: negated); |
} |
- var bang = negated ? '!' : ''; |
- return js.call( |
- "${bang}#", new JS.Call(_emitTopLevelName(_coreIdentical), args)); |
+ var code = negated ? '!#' : '#'; |
+ return js.call(code, new JS.Call(_emitTopLevelName(_coreIdentical), args)); |
} |
/// Emits a function call, to a top-level function, local function, or |
@@ -4183,7 +4182,6 @@ class CodeGenerator extends Object |
return _emitCoreIdenticalCall([left, right], negated: negated); |
} |
- var bang = op.type == TokenType.BANG_EQ ? '!' : ''; |
var leftElement = leftType.element; |
// If either is null, we can use simple equality. |
@@ -4205,12 +4203,12 @@ class CodeGenerator extends Object |
leftType is FunctionType || |
isNullable(left)) { |
// Fall back to equality for now. |
- var code = '${bang}#.equals(#, #)'; |
+ var code = negated ? '!#.equals(#, #)' : '#.equals(#, #)'; |
return js.call(code, [_runtimeModule, _visit(left), _visit(right)]); |
} |
var name = _emitMemberName('==', type: leftType); |
- var code = '${bang}#[#](#)'; |
+ var code = negated ? '!#[#](#)' : '#[#](#)'; |
return js.call(code, [_visit(left), name, _visit(right)]); |
} |