Index: test/mjsunit/harmony/atomics.js |
diff --git a/test/mjsunit/harmony/atomics.js b/test/mjsunit/harmony/atomics.js |
index e608df3342f2ea6a56428dc652a74e5615b83692..840d00e78b12691ad77343f3323a4c984b013f8e 100644 |
--- a/test/mjsunit/harmony/atomics.js |
+++ b/test/mjsunit/harmony/atomics.js |
@@ -386,6 +386,15 @@ function clearArray(sab) { |
})(); |
(function TestIsLockFree() { |
+ // Various invalid cases. |
+ var valueOf = {valueOf: function(){ return 3;}}; |
+ var toString = {toString: function(){ return '3';}}; |
+ var invalid = [3.14, 'foo', Infinity, NaN, false, undefined, valueOf, |
+ toString]; |
+ invalid.forEach(function(v) { |
+ assertEquals(false, Atomics.isLockFree(v), JSON.stringify(v)); |
+ }); |
+ |
// For all platforms we support, 1, 2 and 4 bytes should be lock-free. |
assertEquals(true, Atomics.isLockFree(1)); |
assertEquals(true, Atomics.isLockFree(2)); |