mirror of
https://github.com/denoland/deno.git
synced 2024-12-24 08:09:08 -05:00
fix(node): repl._builtinLibs (#20046)
Ref https://github.com/denoland/deno/issues/19733
This commit is contained in:
parent
5311f69bbb
commit
8d8a89ceea
6 changed files with 23 additions and 2 deletions
|
@ -73,6 +73,7 @@ util::unit_test_factory!(
|
||||||
process_test,
|
process_test,
|
||||||
querystring_test,
|
querystring_test,
|
||||||
readline_test,
|
readline_test,
|
||||||
|
repl_test,
|
||||||
stream_test,
|
stream_test,
|
||||||
string_decoder_test,
|
string_decoder_test,
|
||||||
timers_test,
|
timers_test,
|
||||||
|
|
17
cli/tests/unit_node/repl_test.ts
Normal file
17
cli/tests/unit_node/repl_test.ts
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
// deno-lint-ignore-file no-undef
|
||||||
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
import repl from "node:repl";
|
||||||
|
import { assert } from "../../../test_util/std/testing/asserts.ts";
|
||||||
|
|
||||||
|
Deno.test({
|
||||||
|
name: "repl module exports",
|
||||||
|
fn() {
|
||||||
|
assert(typeof repl.REPLServer !== "undefined");
|
||||||
|
assert(typeof repl.start !== "undefined");
|
||||||
|
// @ts-ignore not present in declaration files, but libraries depend on it
|
||||||
|
assert(typeof repl.builtinModules !== "undefined");
|
||||||
|
// @ts-ignore not present in declaration files, but libraries depend on it
|
||||||
|
assert(typeof repl._builtinLibs !== "undefined");
|
||||||
|
},
|
||||||
|
});
|
|
@ -452,7 +452,6 @@ deno_core::extension!(deno_node,
|
||||||
"path/mod.ts",
|
"path/mod.ts",
|
||||||
"path/separator.ts",
|
"path/separator.ts",
|
||||||
"readline/promises.ts",
|
"readline/promises.ts",
|
||||||
"repl.ts",
|
|
||||||
"wasi.ts",
|
"wasi.ts",
|
||||||
"assert.ts" with_specifier "node:assert",
|
"assert.ts" with_specifier "node:assert",
|
||||||
"assert/strict.ts" with_specifier "node:assert/strict",
|
"assert/strict.ts" with_specifier "node:assert/strict",
|
||||||
|
@ -485,6 +484,7 @@ deno_core::extension!(deno_node,
|
||||||
"punycode.ts" with_specifier "node:punycode",
|
"punycode.ts" with_specifier "node:punycode",
|
||||||
"querystring.ts" with_specifier "node:querystring",
|
"querystring.ts" with_specifier "node:querystring",
|
||||||
"readline.ts" with_specifier "node:readline",
|
"readline.ts" with_specifier "node:readline",
|
||||||
|
"repl.ts" with_specifier "node:repl",
|
||||||
"stream.ts" with_specifier "node:stream",
|
"stream.ts" with_specifier "node:stream",
|
||||||
"stream/consumers.mjs" with_specifier "node:stream/consumers",
|
"stream/consumers.mjs" with_specifier "node:stream/consumers",
|
||||||
"stream/promises.mjs" with_specifier "node:stream/promises",
|
"stream/promises.mjs" with_specifier "node:stream/promises",
|
||||||
|
|
|
@ -55,6 +55,7 @@ generate_builtin_node_module_lists! {
|
||||||
"process",
|
"process",
|
||||||
"punycode",
|
"punycode",
|
||||||
"querystring",
|
"querystring",
|
||||||
|
"repl",
|
||||||
"readline",
|
"readline",
|
||||||
"stream",
|
"stream",
|
||||||
"stream/consumers",
|
"stream/consumers",
|
||||||
|
|
|
@ -110,7 +110,7 @@ import process from "node:process";
|
||||||
import querystring from "node:querystring";
|
import querystring from "node:querystring";
|
||||||
import readline from "node:readline";
|
import readline from "node:readline";
|
||||||
import readlinePromises from "ext:deno_node/readline/promises.ts";
|
import readlinePromises from "ext:deno_node/readline/promises.ts";
|
||||||
import repl from "ext:deno_node/repl.ts";
|
import repl from "node:repl";
|
||||||
import stream from "node:stream";
|
import stream from "node:stream";
|
||||||
import streamConsumers from "node:stream/consumers";
|
import streamConsumers from "node:stream/consumers";
|
||||||
import streamPromises from "node:stream/promises";
|
import streamPromises from "node:stream/promises";
|
||||||
|
|
|
@ -52,11 +52,13 @@ export const builtinModules = [
|
||||||
"worker_threads",
|
"worker_threads",
|
||||||
"zlib",
|
"zlib",
|
||||||
];
|
];
|
||||||
|
export const _builtinLibs = builtinModules;
|
||||||
export function start() {
|
export function start() {
|
||||||
notImplemented("repl.start");
|
notImplemented("repl.start");
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
REPLServer,
|
REPLServer,
|
||||||
builtinModules,
|
builtinModules,
|
||||||
|
_builtinLibs,
|
||||||
start,
|
start,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue