Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: test/mjsunit/harmony/atomics.js

Issue 2658143003: [SAB] Handle non-numerics in Atomics.isLockFree (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/js/harmony-atomics.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « src/js/harmony-atomics.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698