Bug 1062484 - Change value of String.fromCodePoint.length to 1. r=till

This commit is contained in:
ziyunfei 2014-09-04 22:38:48 +08:00
Родитель bc89cfa2a7
Коммит 3581bae876
3 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -148,8 +148,8 @@ function String_localeCompare(that) {
return intl_CompareStrings(collator, S, That);
}
/* ES6 Draft September 5, 2013 21.1.2.2 */
function String_static_fromCodePoint() {
// ES6 draft rev27 (2014/08/24) 21.1.2.2 String.fromCodePoint(...codePoints)
function String_static_fromCodePoint(codePoints) {
// Step 1. is not relevant
// Step 2.
var length = arguments.length;

Просмотреть файл

@ -4285,7 +4285,7 @@ js::str_fromCharCode_one_arg(JSContext *cx, HandleValue code, MutableHandleValue
static const JSFunctionSpec string_static_methods[] = {
JS_FN("fromCharCode", js::str_fromCharCode, 1, 0),
JS_SELF_HOSTED_FN("fromCodePoint", "String_static_fromCodePoint", 0,0),
JS_SELF_HOSTED_FN("fromCodePoint", "String_static_fromCodePoint", 1, 0),
JS_SELF_HOSTED_FN("raw", "String_static_raw", 2, 0),
// This must be at the end because of bug 853075: functions listed after

Просмотреть файл

@ -6,7 +6,7 @@ print(BUGNUMBER + ": " + summary);
// Tests taken from:
// https://github.com/mathiasbynens/String.fromCodePoint/blob/master/tests/tests.js
assertEq(String.fromCodePoint.length, 0);
assertEq(String.fromCodePoint.length, 1);
assertEq(String.propertyIsEnumerable('fromCodePoint'), false);
assertEq(String.fromCodePoint(''), '\0');