Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 937f5b086b41029a1e4c70130ae3953cca3d1fe8..f6a6d8d147d356129bd17f80d6a200695b9899e4 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -10611,23 +10611,27 @@ HValue* HGraphBuilder::BuildBinaryOperation( |
} |
// Convert left argument as necessary. |
- if (left_type->Is(Type::Number())) { |
+ if (left_type->Is(Type::Number()) && !is_strong(language_mode)) { |
DCHECK(right_type->Is(Type::String())); |
left = BuildNumberToString(left, left_type); |
} else if (!left_type->Is(Type::String())) { |
DCHECK(right_type->Is(Type::String())); |
- HValue* function = AddLoadJSBuiltin(Builtins::STRING_ADD_RIGHT); |
+ HValue* function = AddLoadJSBuiltin(is_strong(language_mode) ? |
+ Builtins::STRING_ADD_RIGHT_STRONG : |
+ Builtins::STRING_ADD_RIGHT); |
Add<HPushArguments>(left, right); |
return AddUncasted<HInvokeFunction>(function, 2); |
} |
// Convert right argument as necessary. |
- if (right_type->Is(Type::Number())) { |
+ if (right_type->Is(Type::Number()) && !is_strong(language_mode)) { |
DCHECK(left_type->Is(Type::String())); |
right = BuildNumberToString(right, right_type); |
} else if (!right_type->Is(Type::String())) { |
DCHECK(left_type->Is(Type::String())); |
- HValue* function = AddLoadJSBuiltin(Builtins::STRING_ADD_LEFT); |
+ HValue* function = AddLoadJSBuiltin(is_strong(language_mode) ? |
+ Builtins::STRING_ADD_LEFT_STRONG : |
+ Builtins::STRING_ADD_LEFT); |
Add<HPushArguments>(left, right); |
return AddUncasted<HInvokeFunction>(function, 2); |
} |