mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
Add function encodeInto to TextEncoder, and add MessageChannel to the encodeInto.any.js test. Fixes: https://github.com/nodejs/node/issues/28851 Fixes: https://github.com/nodejs/node/issues/26904 Refs: https://github.com/nodejs/node/pull/28862 Co-authored-by: AtticusYang <yyongtai@163.com> PR-URL: https://github.com/nodejs/node/pull/29524 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
20 lines
440 B
JavaScript
20 lines
440 B
JavaScript
'use strict';
|
|
|
|
// Flags: --expose-internals
|
|
|
|
require('../common');
|
|
const { MessageChannel } = require('worker_threads');
|
|
const { WPTRunner } = require('../common/wpt');
|
|
const runner = new WPTRunner('encoding');
|
|
|
|
// Copy global descriptors from the global object
|
|
runner.copyGlobalsFromObject(global, ['TextDecoder', 'TextEncoder']);
|
|
|
|
runner.defineGlobal('MessageChannel', {
|
|
get() {
|
|
return MessageChannel;
|
|
}
|
|
});
|
|
|
|
runner.runJsTests();
|