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

Unified Diff: src/array.js

Issue 5862002: Version 3.0.2. (Closed)
Patch Set: Created 10 years 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
Index: src/array.js
diff --git a/src/array.js b/src/array.js
index a805157b13b516977189bd7c67b83654e448c36a..c5ff505c1dc849872b6c9baa9b82e310942b3e0d 100644
--- a/src/array.js
+++ b/src/array.js
@@ -159,11 +159,9 @@ function Join(array, length, separator, convert) {
}
-function ConvertToString(x) {
- if (IS_STRING(x)) return x;
- if (IS_NUMBER(x)) return %_NumberToString(x);
- if (IS_BOOLEAN(x)) return x ? 'true' : 'false';
- return (IS_NULL_OR_UNDEFINED(x)) ? '' : %ToString(%DefaultString(x));
+function ConvertToString(e) {
+ if (e == null) return '';
+ else return ToString(e);
}
@@ -367,13 +365,14 @@ function ArrayJoin(separator) {
if (IS_UNDEFINED(separator)) {
separator = ',';
} else if (!IS_STRING(separator)) {
- separator = NonStringToString(separator);
+ separator = ToString(separator);
}
var result = %_FastAsciiArrayJoin(this, separator);
if (!IS_UNDEFINED(result)) return result;
- return Join(this, TO_UINT32(this.length), separator, ConvertToString);
+ var length = TO_UINT32(this.length);
+ return Join(this, length, separator, ConvertToString);
}
« ChangeLog ('K') | « src/arm/macro-assembler-arm.cc ('k') | src/assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698