summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/external-array.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-02-23 16:35:46 -0800
committerisaacs <i@izs.me>2012-02-27 12:11:09 -0800
commitf4641bd4de566145e99b05c47c8f3d629b0223cd (patch)
tree2d0ccb1c338bec65881b30c49707d9e688fed154 /deps/v8/test/mjsunit/external-array.js
parent82ad1f87fa99b420a97cc9bfae727fce0b1bf8a4 (diff)
downloadnode-new-f4641bd4de566145e99b05c47c8f3d629b0223cd.tar.gz
Update v8 to 3.9.9
Diffstat (limited to 'deps/v8/test/mjsunit/external-array.js')
-rw-r--r--deps/v8/test/mjsunit/external-array.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/external-array.js b/deps/v8/test/mjsunit/external-array.js
index 72cfd85956..32f78a72d4 100644
--- a/deps/v8/test/mjsunit/external-array.js
+++ b/deps/v8/test/mjsunit/external-array.js
@@ -317,3 +317,37 @@ for (var t = 0; t < types.length; t++) {
%DeoptimizeFunction(array_load_set_smi_check2);
gc(); // Makes V8 forget about type information for array_load_set_smi_check.
}
+
+// Check handling of undefined in 32- and 64-bit external float arrays.
+
+function store_float32_undefined(ext_array) {
+ ext_array[0] = undefined;
+}
+
+var float32_array = new Float32Array(1);
+// Make sure runtime does it right
+store_float32_undefined(float32_array);
+assertTrue(isNaN(float32_array[0]));
+// Make sure the ICs do it right
+store_float32_undefined(float32_array);
+assertTrue(isNaN(float32_array[0]));
+// Make sure that Cranskshft does it right.
+%OptimizeFunctionOnNextCall(store_float32_undefined);
+store_float32_undefined(float32_array);
+assertTrue(isNaN(float32_array[0]));
+
+function store_float64_undefined(ext_array) {
+ ext_array[0] = undefined;
+}
+
+var float64_array = new Float64Array(1);
+// Make sure runtime does it right
+store_float64_undefined(float64_array);
+assertTrue(isNaN(float64_array[0]));
+// Make sure the ICs do it right
+store_float64_undefined(float64_array);
+assertTrue(isNaN(float64_array[0]));
+// Make sure that Cranskshft does it right.
+%OptimizeFunctionOnNextCall(store_float64_undefined);
+store_float64_undefined(float64_array);
+assertTrue(isNaN(float64_array[0]));