Skip to content

Commit

Permalink
fix structuredClone
Browse files Browse the repository at this point in the history
  • Loading branch information
youennf committed Apr 13, 2023
1 parent 557edc9 commit aacc034
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 1 addition & 7 deletions reference-implementation/lib/abstract-ops/miscellaneous.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,5 @@ exports.CloneAsUint8Array = O => {
};

exports.StructuredTransferOrClone = (value, transferList) => {
console.log(globalThis);
console.log(globalThis.structuredClone);

if (globalThis.structuredClone)
return globalThis.structuredClone(value, transferList);

return JSON.parse(JSON.stringify(value));
return globalThis.structuredClone(value, { transfer : transferList });
};
1 change: 1 addition & 0 deletions reference-implementation/run-web-platform-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ async function main() {
}
};
};
window.structuredClone = structuredClone;
window.eval(bundledJS);
},
filter(testPath) {
Expand Down

0 comments on commit aacc034

Please sign in to comment.