From 332be5b8bc5e6498fd1a9420df083eb4c1b710eb Mon Sep 17 00:00:00 2001 From: jugglinmike Date: Tue, 17 May 2016 14:30:53 -0400 Subject: [PATCH] Correct test for NaN canonicalization (#640) Because implementations are free to select any valid NaN value during GetValueFromBuffer, tests concerning semantics for consistent NaN value encoding cannot rely on values returned from that abstract operation. Update the test for `%TypedArray%.prototype.map` to set the same NaN values via `map` as set in the "control" array. --- ...urn-new-typedarray-conversion-operation-consistent-nan.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/built-ins/TypedArray/prototype/map/return-new-typedarray-conversion-operation-consistent-nan.js b/test/built-ins/TypedArray/prototype/map/return-new-typedarray-conversion-operation-consistent-nan.js index 0a7a8636eb..b85b0cd4e9 100644 --- a/test/built-ins/TypedArray/prototype/map/return-new-typedarray-conversion-operation-consistent-nan.js +++ b/test/built-ins/TypedArray/prototype/map/return-new-typedarray-conversion-operation-consistent-nan.js @@ -46,9 +46,10 @@ includes: [nans.js, testTypedArray.js, compareArray.js] function body(FloatArray) { var sample = new FloatArray(distinctNaNs); var sampleBytes, resultBytes; + var i = 0; - var result = sample.map(function(value) { - return value; + var result = sample.map(function() { + return distinctNaNs[i++]; }); sampleBytes = new Uint8Array(sample.buffer);