diff options
Diffstat (limited to 'test/built-ins/TypedArray/prototype/copyWithin/coerced-values-start.js')
-rw-r--r-- | test/built-ins/TypedArray/prototype/copyWithin/coerced-values-start.js | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-start.js b/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-start.js index 96819e395..c6f766c08 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-start.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-start.js @@ -28,64 +28,56 @@ includes: [compareArray.js, testTypedArray.js] testWithTypedArrayConstructors(function(TA) { assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, undefined), - [0, 0, 1, 2] + new TA([0, 1, 2, 3]).copyWithin(1, undefined), [0, 0, 1, 2] ), 'undefined value coerced to 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, false), - [0, 0, 1, 2] + new TA([0, 1, 2, 3]).copyWithin(1, false), [0, 0, 1, 2] ), 'false value coerced to 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, NaN), - [0, 0, 1, 2] + new TA([0, 1, 2, 3]).copyWithin(1, NaN), [0, 0, 1, 2] ), 'NaN value coerced to 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, null), - [0, 0, 1, 2] + new TA([0, 1, 2, 3]).copyWithin(1, null), [0, 0, 1, 2] ), 'null value coerced to 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, true), - [1, 2, 3, 3] + new TA([0, 1, 2, 3]).copyWithin(0, true), [1, 2, 3, 3] ), 'true value coerced to 1' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, '1'), - [1, 2, 3, 3] + new TA([0, 1, 2, 3]).copyWithin(0, '1'), [1, 2, 3, 3] ), 'string "1" value coerced to 1' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, 0.5), - [0, 0, 1, 2] + new TA([0, 1, 2, 3]).copyWithin(1, 0.5), [0, 0, 1, 2] ), '0.5 float value coerced to integer 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, 1.5), - [1, 2, 3, 3] + new TA([0, 1, 2, 3]).copyWithin(0, 1.5), [1, 2, 3, 3] ), '1.5 float value coerced to integer 1' ); |