haikuwebkit/LayoutTests/js/array-fill-expected.txt

27 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

This test checks the behavior of the Array.prototype.fill()
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Array.prototype methods must use ToLength https://bugs.webkit.org/show_bug.cgi?id=144128 Reviewed by Oliver Hunt. Source/JavaScriptCore: Per https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength This patch introduces ToLength and ToInteger JS implementation to encourage the DFG/FTL's inlining. These implementations are located in GlobalObject.js. And set to the JSGlobalObject with the private symbols @ToLength and @ToInteger manually. * builtins/Array.prototype.js: (every): (forEach): (filter): (map): (some): (fill): (find): (findIndex): (includes): * builtins/ArrayConstructor.js: (from): * builtins/GlobalObject.js: Copied from Source/JavaScriptCore/builtins/StringConstructor.js. (ToInteger): (ToLength): * builtins/StringConstructor.js: (raw): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): * runtime/JSGlobalObjectFunctions.h: LayoutTests: * fast/profiler/built-in-function-calls-anonymous-expected.txt: * fast/profiler/built-in-function-calls-user-defined-function-expected.txt: * js/array-every-expected.txt: * js/array-fill-expected.txt: * js/array-filter-expected.txt: * js/array-find-expected.txt: * js/array-findIndex-expected.txt: * js/array-functions-non-arrays-expected.txt: * js/array-includes-expected.txt: * js/script-tests/array-every.js: (throwError): * js/script-tests/array-fill.js: (throwError): * js/script-tests/array-filter.js: (throwError): * js/script-tests/array-find.js: (throwError): * js/script-tests/array-findIndex.js: (toObject): (throwError): * js/script-tests/array-functions-non-arrays.js: (throwError): * js/script-tests/array-includes.js: Canonical link: https://commits.webkit.org/163178@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-19 19:51:46 +00:00
PASS Array.prototype.fill.length is 1
PASS Array.prototype.fill.name is 'fill'
PASS [0, 0, 0, 0, 0].fill() is [undefined, undefined, undefined, undefined, undefined]
PASS [0, 0, 0, 0, 0].fill(3) is [3, 3, 3, 3, 3]
PASS [0, 0, 0, 0, 0].fill(3, 1) is [0, 3, 3, 3, 3]
PASS [0, 0, 0, 0, 0].fill(3, 1, 3) is [0, 3, 3, 0, 0]
PASS [0, 0, 0, 0, 0].fill(3, 1, 1000) is [0, 3, 3, 3, 3]
PASS [0, 0, 0, 0, 0].fill(3, -2, 1000) is [0, 0, 0, 3, 3]
PASS [0, 0, 0, 0, 0].fill(3, -2, 4) is [0, 0, 0, 3, 0]
PASS [0, 0, 0, 0, 0].fill(3, -2, -1) is [0, 0, 0, 3, 0]
PASS [0, 0, 0, 0, 0].fill(3, -2, -3) is [0, 0, 0, 0, 0]
PASS [0, 0, 0, 0, 0].fill(3, undefined, 4) is [3, 3, 3, 3, 0]
PASS [ , , , , 0].fill(3, 1, 3) is [, 3, 3, , 0]
Array.prototype methods must use ToLength https://bugs.webkit.org/show_bug.cgi?id=144128 Reviewed by Oliver Hunt. Source/JavaScriptCore: Per https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength This patch introduces ToLength and ToInteger JS implementation to encourage the DFG/FTL's inlining. These implementations are located in GlobalObject.js. And set to the JSGlobalObject with the private symbols @ToLength and @ToInteger manually. * builtins/Array.prototype.js: (every): (forEach): (filter): (map): (some): (fill): (find): (findIndex): (includes): * builtins/ArrayConstructor.js: (from): * builtins/GlobalObject.js: Copied from Source/JavaScriptCore/builtins/StringConstructor.js. (ToInteger): (ToLength): * builtins/StringConstructor.js: (raw): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): * runtime/JSGlobalObjectFunctions.h: LayoutTests: * fast/profiler/built-in-function-calls-anonymous-expected.txt: * fast/profiler/built-in-function-calls-user-defined-function-expected.txt: * js/array-every-expected.txt: * js/array-fill-expected.txt: * js/array-filter-expected.txt: * js/array-find-expected.txt: * js/array-findIndex-expected.txt: * js/array-functions-non-arrays-expected.txt: * js/array-includes-expected.txt: * js/script-tests/array-every.js: (throwError): * js/script-tests/array-fill.js: (throwError): * js/script-tests/array-filter.js: (throwError): * js/script-tests/array-find.js: (throwError): * js/script-tests/array-findIndex.js: (toObject): (throwError): * js/script-tests/array-functions-non-arrays.js: (throwError): * js/script-tests/array-includes.js: Canonical link: https://commits.webkit.org/163178@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-05-19 19:51:46 +00:00
Array-like object with invalid lengths
PASS var obj = Object.freeze({ 0: 1, length: 0 }); Array.prototype.fill.call(obj, throwError); JSON.stringify(obj) is '{"0":1,"length":0}'
PASS var obj = Object.freeze({ 0: 1, length: -0 }); Array.prototype.fill.call(obj, throwError); JSON.stringify(obj) is '{"0":1,"length":0}'
PASS var obj = Object.freeze({ 0: 1, length: -3 }); Array.prototype.fill.call(obj, throwError); JSON.stringify(obj) is '{"0":1,"length":-3}'
PASS successfullyParsed is true
TEST COMPLETE