Index: src/harmony-atomics.js |
diff --git a/src/harmony-atomics.js b/src/harmony-atomics.js |
index aa81822d1e2f877f4de933f02d269b81775eea11..e801939acbd229b581ae12e9ad0d5941290bc876 100644 |
--- a/src/harmony-atomics.js |
+++ b/src/harmony-atomics.js |
@@ -36,6 +36,8 @@ function AtomicsCompareExchangeJS(sta, index, oldValue, newValue) { |
if (index < 0 || index >= sta.length) { |
return UNDEFINED; |
} |
+ oldValue = $toNumber(oldValue); |
+ newValue = $toNumber(newValue); |
return %_AtomicsCompareExchange(sta, index, oldValue, newValue); |
} |
@@ -54,6 +56,7 @@ function AtomicsStoreJS(sta, index, value) { |
if (index < 0 || index >= sta.length) { |
return UNDEFINED; |
} |
+ value = $toNumber(value); |
return %_AtomicsStore(sta, index, value); |
} |
@@ -63,6 +66,7 @@ function AtomicsAddJS(ia, index, value) { |
if (index < 0 || index >= ia.length) { |
return UNDEFINED; |
} |
+ value = $toNumber(value); |
return %_AtomicsAdd(ia, index, value); |
} |
@@ -72,6 +76,7 @@ function AtomicsSubJS(ia, index, value) { |
if (index < 0 || index >= ia.length) { |
return UNDEFINED; |
} |
+ value = $toNumber(value); |
return %_AtomicsSub(ia, index, value); |
} |
@@ -81,6 +86,7 @@ function AtomicsAndJS(ia, index, value) { |
if (index < 0 || index >= ia.length) { |
return UNDEFINED; |
} |
+ value = $toNumber(value); |
return %_AtomicsAnd(ia, index, value); |
} |
@@ -90,6 +96,7 @@ function AtomicsOrJS(ia, index, value) { |
if (index < 0 || index >= ia.length) { |
return UNDEFINED; |
} |
+ value = $toNumber(value); |
return %_AtomicsOr(ia, index, value); |
} |
@@ -99,6 +106,7 @@ function AtomicsXorJS(ia, index, value) { |
if (index < 0 || index >= ia.length) { |
return UNDEFINED; |
} |
+ value = $toNumber(value); |
return %_AtomicsXor(ia, index, value); |
} |
@@ -108,6 +116,7 @@ function AtomicsExchangeJS(ia, index, value) { |
if (index < 0 || index >= ia.length) { |
return UNDEFINED; |
} |
+ value = $toNumber(value); |
return %_AtomicsExchange(ia, index, value); |
} |