Revision: 22447
Author: [email protected]
Date: Thu Jul 17 10:54:25 2014 UTC
Log: Change String.prototype.concat to be more like similar functions.
This is just cosmetic: We usually avoid using %FunctionSetLength.
[email protected]
Review URL: https://codereview.chromium.org/400583002
http://code.google.com/p/v8/source/detail?r=22447
Modified:
/branches/bleeding_edge/src/string.js
=======================================
--- /branches/bleeding_edge/src/string.js Mon Jul 14 14:05:30 2014 UTC
+++ /branches/bleeding_edge/src/string.js Thu Jul 17 10:54:25 2014 UTC
@@ -61,13 +61,13 @@
// ECMA-262, section 15.5.4.6
-function StringConcat() {
+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 + %_Arguments(0);
+ return this_as_string + other;
}
var parts = new InternalArray(len + 1);
parts[0] = this_as_string;
@@ -77,9 +77,6 @@
}
return %StringBuilderConcat(parts, len + 1, "");
}
-
-// Match ES3 and Safari
-%FunctionSetLength(StringConcat, 1);
// ECMA-262 section 15.5.4.7
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.