Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixes
  • Loading branch information
Ethan-Arrowood committed Aug 13, 2021
commit 8e8356887a2e85e2fe2caf879feeb96c3af1a1ea
1 change: 0 additions & 1 deletion lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ ObjectDefineProperty(process, 'features', {
}

const { emitWarning } = require('internal/process/warning');
const { structuredClone } = require('internal/structured_clone');
process.emitWarning = emitWarning;

// We initialize the tick callbacks and the timer callbacks last during
Expand Down
7 changes: 4 additions & 3 deletions lib/internal/structured_clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ const {
receiveMessageOnPort
Comment thread
Ethan-Arrowood marked this conversation as resolved.
Outdated
} = require('internal/worker/io');

let channel
let channel;
function structuredClone(value, transfer) {
// TODO: Improve this with a more efficient solution that avoids instantiating a MessageChannel
// TODO: Improve this with a more efficient solution that avoids
// instantiating a MessageChannel
if (!channel) {
channel = new MessageChannel();
}
Expand All @@ -19,4 +20,4 @@ function structuredClone(value, transfer) {

module.exports = {
structuredClone
}
};
2 changes: 1 addition & 1 deletion test/fixtures/wpt/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@
"commit": "cdd0f03df41b222aed098fbbb11c6a3cc500a86b",
"path": "WebCryptoAPI"
}
}
}
2 changes: 1 addition & 1 deletion test/parallel/test-global.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ builtinModules.forEach((moduleName) => {
'setImmediate',
'setInterval',
'setTimeout',
'structuredClone'
'structuredClone',
];
assert.deepStrictEqual(new Set(Object.keys(global)), new Set(expected));
}
Expand Down
5 changes: 3 additions & 2 deletions test/parallel/test-structuredClone-global.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

require('../common');

const { structuredClone: _structuredClone } = require('internal/structuredClone');
const {
structuredClone: _structuredClone
} = require('internal/structuredClone');
const {
strictEqual
} = require('assert');

Comment thread
Ethan-Arrowood marked this conversation as resolved.
strictEqual(globalThis.structuredClone, _structuredClone);
structuredClone = undefined;
strictEqual(globalThis.structuredClone, undefined);
strictEqual(typeof perf_hooks.performance.now, 'function');

// Restore the value of performance for the known globals check
Comment thread
Ethan-Arrowood marked this conversation as resolved.
Outdated
structuredClone = _structuredClone;
2 changes: 1 addition & 1 deletion test/wpt/status/html/webappapis/structured-clone.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"structured-clone.any.js": {
"skip": "Missing File API"
}
}
}
2 changes: 1 addition & 1 deletion test/wpt/test-structured-clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ runner.setInitScript(`
global.Blob = Blob;
`);

runner.runJsTests();
runner.runJsTests();