Files
node/test/wpt/test-encoding.js
T
Anna HenningsenandAtticusYang 772a5e0658 util: add encodeInto to TextEncoder
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>
2019-09-25 18:20:53 +02:00

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();