Skip to content

Commit 0ed7572

Browse files
committed
fix
1 parent 00a38d0 commit 0ed7572

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

runtime/weak.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ function caml_ephe_get_data(x) {
185185
x[caml_ephe_data_offset] = caml_ephe_none;
186186
return 0;
187187
}
188-
data = data.get(d);
188+
data = data.get(k);
189189
if (data === undefined) {
190190
x[caml_ephe_data_offset] = caml_ephe_none;
191191
return 0;
@@ -207,7 +207,7 @@ function caml_ephe_get_data_copy(x) {
207207
//Requires: caml_ephe_data_offset, caml_ephe_key_offset
208208
//Requires: caml_ephe_none
209209
function caml_ephe_set_data(x, data) {
210-
for (var i = caml_ephe_key_offset; i < x.length; i++) {
210+
for (var i = x.length - 1; i >= caml_ephe_key_offset; i --) {
211211
var k = x[i];
212212
if (k === caml_ephe_none) continue;
213213
if (!(globalThis.WeakRef && k instanceof globalThis.WeakRef)) continue;

0 commit comments

Comments
 (0)