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.
This commit is contained in:
jugglinmike 2016-05-17 14:30:53 -04:00 committed by Leo Balter
parent d8f1b92cf4
commit 332be5b8bc
1 changed files with 3 additions and 2 deletions

View File

@ -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);