diff --git a/test/built-ins/Array/prototype/findLastIndex/array-altered-during-loop.js b/test/built-ins/Array/prototype/findLastIndex/array-altered-during-loop.js new file mode 100644 index 0000000000..be825f22ce --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/array-altered-during-loop.js @@ -0,0 +1,46 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: > + The range of elements processed is set before the first call to `predicate`. +info: | + Array.prototype.findLastIndex ( predicate[ , thisArg ] ) + + ... + 4. Let k be len - 1. + 5. Repeat, while k ≥ 0, + ... + c. Let testResult be ! ToBoolean(? Call(predicate, thisArg, « kValue, 𝔽(k), O »)). + ... +---*/ + +var arr = ['Shoes', 'Car', 'Bike']; +var results = []; + +arr.findLastIndex(function(kValue) { + if (results.length === 0) { + arr.splice(1, 1); + } + results.push(kValue); +}); + +assert.sameValue(results.length, 3, 'predicate called three times'); +assert.sameValue(results[0], 'Bike'); +assert.sameValue(results[1], 'Bike'); +assert.sameValue(results[2], 'Shoes'); + +results = []; +arr = ['Skateboard', 'Barefoot']; +arr.findLastIndex(function(kValue) { + if (results.length === 0) { + arr.push('Motorcycle'); + arr[1] = 'Magic Carpet'; + } + + results.push(kValue); +}); + +assert.sameValue(results.length, 2, 'predicate called twice'); +assert.sameValue(results[0], 'Barefoot'); +assert.sameValue(results[1], 'Magic Carpet'); diff --git a/test/built-ins/Array/prototype/findLastIndex/call-with-boolean.js b/test/built-ins/Array/prototype/findLastIndex/call-with-boolean.js new file mode 100644 index 0000000000..9663fc889c --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/call-with-boolean.js @@ -0,0 +1,18 @@ +// Copyright (c) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.findlastindex +description: Array.prototype.findLastIndex applied to boolean primitive +---*/ + +assert.sameValue( + Array.prototype.findLastIndex.call(true, () => {}), + -1, + 'Array.prototype.findLastIndex.call(true, () => {}) must return -1' +); +assert.sameValue( + Array.prototype.findLastIndex.call(false, () => {}), + -1, + 'Array.prototype.findLastIndex.call(false, () => {}) must return -1' +); diff --git a/test/built-ins/Array/prototype/findLastIndex/length.js b/test/built-ins/Array/prototype/findLastIndex/length.js new file mode 100644 index 0000000000..ea25b124c7 --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/length.js @@ -0,0 +1,18 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: Array.prototype.findLastIndex.length value and descriptor. +info: | + 17 ECMAScript Standard Built-in Objects +includes: [propertyHelper.js] +---*/ + +assert.sameValue( + Array.prototype.findLastIndex.length, 1, + 'The value of `Array.prototype.findLastIndex.length` is `1`' +); + +verifyNotEnumerable(Array.prototype.findLastIndex, 'length'); +verifyNotWritable(Array.prototype.findLastIndex, 'length'); +verifyConfigurable(Array.prototype.findLastIndex, 'length'); diff --git a/test/built-ins/Array/prototype/findLastIndex/name.js b/test/built-ins/Array/prototype/findLastIndex/name.js new file mode 100644 index 0000000000..be09787297 --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/name.js @@ -0,0 +1,22 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: > + Array.prototype.findLastIndex.name value and descriptor. +info: | + Array.prototype.findLastIndex ( predicate [ , thisArg ] ) + + 17 ECMAScript Standard Built-in Objects + +includes: [propertyHelper.js] +---*/ + +assert.sameValue( + Array.prototype.findIndex.name, 'findLastIndex', + 'The value of `Array.prototype.findLastIndex.name` is `"findLastIndex"`' +); + +verifyNotEnumerable(Array.prototype.findLastIndex, 'name'); +verifyNotWritable(Array.prototype.findLastIndex, 'name'); +verifyConfigurable(Array.prototype.findLastIndex, 'name'); diff --git a/test/built-ins/Array/prototype/findLastIndex/not-a-constructor.js b/test/built-ins/Array/prototype/findLastIndex/not-a-constructor.js new file mode 100644 index 0000000000..46efad2dee --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/not-a-constructor.js @@ -0,0 +1,33 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Array.prototype.findLastIndex does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Array.prototype.findLastIndex), + false, + 'isConstructor(Array.prototype.findLastIndex) must return false' +); + +assert.throws(TypeError, () => { + new Array.prototype.findLastIndex(() => {}); +}, '`new Array.prototype.findLastIndex(() => {})` throws TypeError'); + diff --git a/test/built-ins/Array/prototype/findLastIndex/predicate-call-parameters.js b/test/built-ins/Array/prototype/findLastIndex/predicate-call-parameters.js new file mode 100644 index 0000000000..4279a9b281 --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/predicate-call-parameters.js @@ -0,0 +1,44 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: > + Predicate called as F.call( thisArg, kValue, k, O ) for each array entry. +info: | + Array.prototype.findLastIndex ( predicate[ , thisArg ] ) + + ... + 4. Let k be len - 1. + 5. Repeat, while k ≥ 0, + ... + c. Let testResult be ! ToBoolean(? Call(predicate, thisArg, « kValue, 𝔽(k), O »)). + ... +---*/ + +var arr = ['Mike', 'Rick', 'Leo']; + +var results = []; + +arr.findLastIndex(function(kValue, k, O) { + results.push(arguments); +}); + +assert.sameValue(results.length, 3); + +var result = results[0]; +assert.sameValue(result[0], 'Leo'); +assert.sameValue(result[1], 2); +assert.sameValue(result[2], arr); +assert.sameValue(result.length, 3); + +result = results[1]; +assert.sameValue(result[0], 'Rick'); +assert.sameValue(result[1], 1); +assert.sameValue(result[2], arr); +assert.sameValue(result.length, 3); + +result = results[2]; +assert.sameValue(result[0], 'Mike'); +assert.sameValue(result[1], 0); +assert.sameValue(result[2], arr); +assert.sameValue(result.length, 3); diff --git a/test/built-ins/Array/prototype/findLastIndex/predicate-call-this-non-strict.js b/test/built-ins/Array/prototype/findLastIndex/predicate-call-this-non-strict.js new file mode 100644 index 0000000000..f1fc008b5a --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/predicate-call-this-non-strict.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: > + Predicate thisArg as F.call( thisArg, kValue, k, O ) for each array entry. +info: | + Array.prototype.findLastIndex ( predicate[ , thisArg ] ) + + ... + 5. Repeat, while k ≥ 0, + ... + c. Let testResult be ! ToBoolean(? Call(predicate, thisArg, « kValue, 𝔽(k), O »)). + d. If testResult is true, return 𝔽(k). + ... +flags: [noStrict] +---*/ + +var result; + +[1].findLastIndex(function(kValue, k, O) { + result = this; +}); + +assert.sameValue(result, this); + +var o = {}; +[1].findLastIndex(function() { + result = this; +}, o); + +assert.sameValue(result, o); diff --git a/test/built-ins/Array/prototype/findLastIndex/predicate-call-this-strict.js b/test/built-ins/Array/prototype/findLastIndex/predicate-call-this-strict.js new file mode 100644 index 0000000000..833aad53df --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/predicate-call-this-strict.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: > + Predicate thisArg as F.call( thisArg, kValue, k, O ) for each array entry. +info: | + Array.prototype.findLastIndex ( predicate[ , thisArg ] ) + + ... + 5. Repeat, while k ≥ 0, + ... + c. Let testResult be ! ToBoolean(? Call(predicate, thisArg, « kValue, 𝔽(k), O »)). + d. If testResult is true, return 𝔽(k). + ... +flags: [onlyStrict] +---*/ + +var result; + +[1].findLastIndex(function(kValue, k, O) { + result = this; +}); + +assert.sameValue(result, undefined); + +var o = {}; +[1].findLastIndex(function() { + result = this; +}, o); + +assert.sameValue(result, o); diff --git a/test/built-ins/Array/prototype/findLastIndex/predicate-called-for-each-array-property.js b/test/built-ins/Array/prototype/findLastIndex/predicate-called-for-each-array-property.js new file mode 100644 index 0000000000..0b40a8effd --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/predicate-called-for-each-array-property.js @@ -0,0 +1,25 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: > + Predicate is called for each array property. +info: | + Array.prototype.findLastIndex ( predicate[ , thisArg ] ) + + ... + 4. Let k be len - 1. + 5. Repeat, while k ≥ 0, + ... + c. Let testResult be ! ToBoolean(? Call(predicate, thisArg, « kValue, 𝔽(k), O »)). + ... +---*/ + +var arr = [undefined, , , 'foo']; +var called = 0; + +arr.findLastIndex(function() { + called++; +}); + +assert.sameValue(called, 4); diff --git a/test/built-ins/Array/prototype/findLastIndex/predicate-is-not-callable-throws.js b/test/built-ins/Array/prototype/findLastIndex/predicate-is-not-callable-throws.js new file mode 100644 index 0000000000..981e18c4dd --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/predicate-is-not-callable-throws.js @@ -0,0 +1,49 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: > + Throws a TypeError exception if predicate is not callable. +info: | + Array.prototype.findLastIndex ( predicate[ , thisArg ] ) + + ... + 3. If IsCallable(predicate) is false, throw a TypeError exception. + ... +---*/ + +assert.throws(TypeError, function() { + [].findLastIndex({}); +}); + +assert.throws(TypeError, function() { + [].findLastIndex(null); +}); + +assert.throws(TypeError, function() { + [].findLastIndex(undefined); +}); + +assert.throws(TypeError, function() { + [].findLastIndex(true); +}); + +assert.throws(TypeError, function() { + [].findLastIndex(1); +}); + +assert.throws(TypeError, function() { + [].findLastIndex(''); +}); + +assert.throws(TypeError, function() { + [].findLastIndex(1); +}); + +assert.throws(TypeError, function() { + [].findLastIndex([]); +}); + +assert.throws(TypeError, function() { + [].findLastIndex(/./); +}); diff --git a/test/built-ins/Array/prototype/findLastIndex/predicate-not-called-on-empty-array.js b/test/built-ins/Array/prototype/findLastIndex/predicate-not-called-on-empty-array.js new file mode 100644 index 0000000000..5950c67b1d --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/predicate-not-called-on-empty-array.js @@ -0,0 +1,34 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: > + Predicate is only called if this.length is > 0. +info: | + Array.prototype.findLastIndex ( predicate[ , thisArg ] ) + + ... + 4. Let k be len - 1. + 5. Repeat, while k ≥ 0, + ... + c. Let testResult be ! ToBoolean(? Call(predicate, thisArg, « kValue, 𝔽(k), O »)). + 6. Return -1. +---*/ + +var called = false; + +var predicate = function() { + called = true; + return true; +}; + +var result = [].findLastIndex(predicate); + +assert.sameValue( + called, false, + '[].findLastIndex(predicate) does not call predicate' +); +assert.sameValue( + result, -1, + '[].findLastIndex(predicate) returned undefined' +); diff --git a/test/built-ins/Array/prototype/findLastIndex/prop-desc.js b/test/built-ins/Array/prototype/findLastIndex/prop-desc.js new file mode 100644 index 0000000000..ba436716b8 --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/prop-desc.js @@ -0,0 +1,19 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: Property type and descriptor. +info: | + 17 ECMAScript Standard Built-in Objects +includes: [propertyHelper.js] +---*/ + +assert.sameValue( + typeof Array.prototype.findLastIndex, + 'function', + '`typeof Array.prototype.findLastIndex` is `function`' +); + +verifyNotEnumerable(Array.prototype, 'findLastIndex'); +verifyWritable(Array.prototype, 'findLastIndex'); +verifyConfigurable(Array.prototype, 'findLastIndex'); diff --git a/test/built-ins/Array/prototype/findLastIndex/return-abrupt-from-predicate-call.js b/test/built-ins/Array/prototype/findLastIndex/return-abrupt-from-predicate-call.js new file mode 100644 index 0000000000..a536f6b043 --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/return-abrupt-from-predicate-call.js @@ -0,0 +1,25 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: > + Return abrupt from predicate call. +info: | + Array.prototype.findLastIndex ( predicate[ , thisArg ] ) + + ... + 4. Let k be len - 1. + 5. Repeat, while k ≥ 0, + ... + c. Let testResult be ! ToBoolean(? Call(predicate, thisArg, « kValue, 𝔽(k), O »)). + d. If testResult is true, return 𝔽(k). + ... +---*/ + +var predicate = function() { + throw new Test262Error(); +}; + +assert.throws(Test262Error, function() { + [1].findLastIndex(predicate); +}); diff --git a/test/built-ins/Array/prototype/findLastIndex/return-abrupt-from-property.js b/test/built-ins/Array/prototype/findLastIndex/return-abrupt-from-property.js new file mode 100644 index 0000000000..d28a55a162 --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/return-abrupt-from-property.js @@ -0,0 +1,30 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: > + Returns abrupt from getting property value from `this`. +info: | + Array.prototype.findLastIndex ( predicate[ , thisArg ] ) + + ... + 4. Let k be len - 1. + 5. Repeat, while k ≥ 0, + a. Let Pk be ! ToString(𝔽(k)). + b. Let kValue be ? Get(O, Pk). + ... +---*/ + +var o = { + length: 1 +}; + +Object.defineProperty(o, 0, { + get: function() { + throw new Test262Error(); + } +}); + +assert.throws(Test262Error, function() { + [].findLastIndex.call(o, function() {}); +}); diff --git a/test/built-ins/Array/prototype/findLastIndex/return-abrupt-from-this-length-as-symbol.js b/test/built-ins/Array/prototype/findLastIndex/return-abrupt-from-this-length-as-symbol.js new file mode 100644 index 0000000000..f9c0957c87 --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/return-abrupt-from-this-length-as-symbol.js @@ -0,0 +1,23 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: > + Return abrupt from ToLength(Get(O, "length")) where length is a Symbol. +info: | + Array.prototype.findLastIndex ( predicate[ , thisArg ] ) + + 1. Let O be ? ToObject(this value). + 2. Let len be ? LengthOfArrayLike(O). + ... +features: [Symbol] +---*/ + +var o = {}; + +o.length = Symbol(1); + +// predicate fn is given to avoid false positives +assert.throws(TypeError, function() { + [].findLastIndex.call(o, function() {}); +}); diff --git a/test/built-ins/Array/prototype/findLastIndex/return-abrupt-from-this-length.js b/test/built-ins/Array/prototype/findLastIndex/return-abrupt-from-this-length.js new file mode 100644 index 0000000000..b0f4eefa30 --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/return-abrupt-from-this-length.js @@ -0,0 +1,36 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: > + Return abrupt from ToLength(Get(O, "length")). +info: | + Array.prototype.findLastIndex ( predicate[ , thisArg ] ) + + 1. Let O be ? ToObject(this value). + 2. Let len be ? LengthOfArrayLike(O). +---*/ + +var o1 = {}; + +Object.defineProperty(o1, 'length', { + get: function() { + throw new Test262Error(); + }, + configurable: true +}); +// predicate fn is given to avoid false positives +assert.throws(Test262Error, function() { + [].findLastIndex.call(o1, function() {}); +}); + +var o2 = { + length: { + valueOf: function() { + throw new Test262Error(); + } + } +}; +assert.throws(Test262Error, function() { + [].findLastIndex.call(o2, function() {}); +}); diff --git a/test/built-ins/Array/prototype/findLastIndex/return-abrupt-from-this.js b/test/built-ins/Array/prototype/findLastIndex/return-abrupt-from-this.js new file mode 100644 index 0000000000..0316c13650 --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/return-abrupt-from-this.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: > + Return abrupt from ToObject(this value). +info: | + Array.prototype.findLastIndex ( predicate[ , thisArg ] ) + + 1. Let O be ? ToObject(this value). +---*/ + +// predicate fn is given to avoid false positives +assert.throws(TypeError, function() { + Array.prototype.findLastIndex.call(undefined, function() {}); +}); + +assert.throws(TypeError, function() { + Array.prototype.findLastIndex.call(null, function() {}); +}); diff --git a/test/built-ins/Array/prototype/findLastIndex/return-index-predicate-result-is-true.js b/test/built-ins/Array/prototype/findLastIndex/return-index-predicate-result-is-true.js new file mode 100644 index 0000000000..c48da02d56 --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/return-index-predicate-result-is-true.js @@ -0,0 +1,62 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: > + Return index if predicate return a boolean true value. +info: | + Array.prototype.findLastIndex ( predicate[ , thisArg ] ) + + ... + 5. Repeat, while k ≥ 0, + ... + c. Let testResult be ! ToBoolean(? Call(predicate, thisArg, « kValue, 𝔽(k), O »)). + d. If testResult is true, return 𝔽(k). + ... +features: [Symbol] +---*/ + +var arr = ['Shoes', 'Car', 'Bike']; +var called = 0; + +var result = arr.findLastIndex(function(val) { + called++; + return true; +}); + +assert.sameValue(result, 2); +assert.sameValue(called, 1, 'predicate was called once'); + +called = 0; +result = arr.findLastIndex(function(val) { + called++; + return val === 'Bike'; +}); + +assert.sameValue(called, 1, 'predicate was called three times'); +assert.sameValue(result, 2); + +result = arr.findLastIndex(function(val) { + return 'string'; +}); +assert.sameValue(result, 2, 'coerced string'); + +result = arr.findLastIndex(function(val) { + return {}; +}); +assert.sameValue(result, 2, 'coerced object'); + +result = arr.findLastIndex(function(val) { + return Symbol(''); +}); +assert.sameValue(result, 2, 'coerced Symbol'); + +result = arr.findLastIndex(function(val) { + return 1; +}); +assert.sameValue(result, 2, 'coerced number'); + +result = arr.findLastIndex(function(val) { + return -1; +}); +assert.sameValue(result, 2, 'coerced negative number'); diff --git a/test/built-ins/Array/prototype/findLastIndex/return-negative-one-if-predicate-returns-false-value.js b/test/built-ins/Array/prototype/findLastIndex/return-negative-one-if-predicate-returns-false-value.js new file mode 100644 index 0000000000..cb505379a7 --- /dev/null +++ b/test/built-ins/Array/prototype/findLastIndex/return-negative-one-if-predicate-returns-false-value.js @@ -0,0 +1,53 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.prototype.findlastindex +description: > + Return -1 if predicate always returns a boolean false value. +info: | + Array.prototype.findLastIndex ( predicate[ , thisArg ] ) + + ... + 5. Repeat, while k ≥ 0, + ... + c. Let testResult be ! ToBoolean(? Call(predicate, thisArg, « kValue, 𝔽(k), O »)). + ... + 6. Return -1. +features: [Symbol] +---*/ + +var arr = ['Shoes', 'Car', 'Bike']; +var called = 0; + +var result = arr.findLastIndex(function(val) { + called++; + return false; +}); + +assert.sameValue(called, 3, 'predicate was called three times'); +assert.sameValue(result, -1); + +result = arr.findLastIndex(function(val) { + return ''; +}); +assert.sameValue(result, -1, 'coerced string'); + +result = arr.findLastIndex(function(val) { + return undefined; +}); +assert.sameValue(result, -1, 'coerced undefined'); + +result = arr.findLastIndex(function(val) { + return null; +}); +assert.sameValue(result, -1, 'coerced null'); + +result = arr.findLastIndex(function(val) { + return 0; +}); +assert.sameValue(result, -1, 'coerced 0'); + +result = arr.findLastIndex(function(val) { + return NaN; +}); +assert.sameValue(result, -1, 'coerced NaN');