summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/tools
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2020-10-15 20:17:08 +0200
committerMichaël Zasso <targos@protonmail.com>2020-10-18 20:16:47 +0200
commita1d639ba5de4ff34e34fb575fbb6cc1d41ec3cce (patch)
treeabc7d41c12f1495b1208fa4449cb2508c92c5e85 /deps/v8/test/mjsunit/tools
parent089d654dd85f8e548597329f60a41d6029260caa (diff)
downloadnode-new-a1d639ba5de4ff34e34fb575fbb6cc1d41ec3cce.tar.gz
deps: update V8 to 8.6.395
PR-URL: https://github.com/nodejs/node/pull/35415 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/test/mjsunit/tools')
-rw-r--r--deps/v8/test/mjsunit/tools/foozzie.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/deps/v8/test/mjsunit/tools/foozzie.js b/deps/v8/test/mjsunit/tools/foozzie.js
index 67e6547c67..bae1c49ea5 100644
--- a/deps/v8/test/mjsunit/tools/foozzie.js
+++ b/deps/v8/test/mjsunit/tools/foozzie.js
@@ -59,8 +59,8 @@ function testArrayType(arrayType, pattern) {
arr[0] = -NaN;
return new Uint32Array(arr.buffer);
};
- // Test passing NaN using set.
testSameOptimized(pattern, create);
+ // Test passing NaN using set.
create = function() {
const arr = new arrayType(1);
arr.set([-NaN], 0);
@@ -78,6 +78,24 @@ else {
testArrayType(Float64Array, [0, 1072693248]);
}
+// Test that DataView has the same NaN patterns with optimized and
+// unoptimized code.
+var expected_array = [4213246272,405619796,61503,0,3675212096,32831];
+if (isBigEndian){
+ expected_array = [1074340347,1413754136,1072693248,0,1078530011,1065353216];
+}
+testSameOptimized(expected_array, () => {
+ const array = new Uint32Array(6);
+ const view = new DataView(array.buffer);
+ view.setFloat64(0, Math.PI);
+ view.setFloat64(8, -undefined);
+ view.setFloat32(16, Math.fround(Math.PI));
+ view.setFloat32(20, -undefined);
+ assertEquals(Math.PI, view.getFloat64(0));
+ assertEquals(Math.fround(Math.PI), view.getFloat32(16));
+ return array;
+});
+
// Realm.eval is just eval.
assertEquals(1477662728716, Realm.eval(Realm.create(), `Date.now()`));