Skip to content

Commit 74c8927

Browse files
authored
fix(ecmascript): Atomics.notify with zero count (#905)
1 parent f8ac3c9 commit 74c8927

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

nova_vm/src/ecmascript/builtins/structured_data/atomics_object.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,10 @@ impl AtomicsObject {
680680
let gc = gc.into_nogc();
681681
// SAFETY: not shared.
682682
let typed_array = unsafe { typed_array.take(agent) }.bind(gc);
683+
684+
if c == 0 {
685+
return Ok(0.into());
686+
}
683687
// 5. Let buffer be typedArray.[[ViewedArrayBuffer]].
684688
let buffer = typed_array.viewed_array_buffer(agent);
685689
// 7. If IsSharedArrayBuffer(buffer) is false,

tests/expectations.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,6 @@
238238
"built-ins/AsyncIteratorPrototype/Symbol.asyncDispose/throw-rejected-return.js": "FAIL",
239239
"built-ins/AsyncIteratorPrototype/Symbol.asyncDispose/throw-return-getter.js": "FAIL",
240240
"built-ins/AsyncIteratorPrototype/Symbol.asyncDispose/throw-return.js": "FAIL",
241-
"built-ins/Atomics/notify/negative-count.js": "FAIL",
242-
"built-ins/Atomics/notify/notify-nan.js": "FAIL",
243-
"built-ins/Atomics/notify/notify-zero.js": "FAIL",
244241
"built-ins/Atomics/pause/descriptor.js": "FAIL",
245242
"built-ins/Atomics/pause/length.js": "FAIL",
246243
"built-ins/Atomics/pause/name.js": "FAIL",

tests/metrics.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"results": {
33
"crash": 72,
4-
"fail": 7458,
5-
"pass": 39822,
4+
"fail": 7455,
5+
"pass": 39825,
66
"skip": 3325,
77
"timeout": 19,
88
"unresolved": 37

0 commit comments

Comments
 (0)