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

Unified Diff: src/string.js

Issue 1029103002: [es5] call ToString() on argument in String.prototype.concat() fast case (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix nits Created 5 years, 9 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 | « no previous file | test/mjsunit/string-concat.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string.js
diff --git a/src/string.js b/src/string.js
index 6286be3e49d42e8e4fcad7c8b9286e3419d35b40..0f29cd1dc147ca7c8fc6b24c4d965af32754a734 100644
--- a/src/string.js
+++ b/src/string.js
@@ -72,11 +72,10 @@ function StringCharCodeAtJS(pos) {
// ECMA-262, section 15.5.4.6
function StringConcat(other /* and more */) { // length == 1
CHECK_OBJECT_COERCIBLE(this, "String.prototype.concat");
-
var len = %_ArgumentsLength();
var this_as_string = TO_STRING_INLINE(this);
if (len === 1) {
- return this_as_string + other;
+ return this_as_string + TO_STRING_INLINE(other);
}
var parts = new InternalArray(len + 1);
parts[0] = this_as_string;
« no previous file with comments | « no previous file | test/mjsunit/string-concat.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698