Skip to content

Commit

Permalink
refactor(ext/node): remove polyfills/_core.ts (denoland#18766)
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k committed Apr 20, 2023
1 parent 02da57e commit f520284
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 89 deletions.
1 change: 0 additions & 1 deletion ext/node/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ deno_core::extension!(deno_node,
"00_globals.js",
"01_require.js",
"02_init.js",
"_core.ts",
"_events.mjs",
"_fs/_fs_access.ts",
"_fs/_fs_appendFile.ts",
Expand Down
83 changes: 0 additions & 83 deletions ext/node/polyfills/_core.ts

This file was deleted.

3 changes: 2 additions & 1 deletion ext/node/polyfills/_next_tick.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Copyright Joyent, Inc. and other Node contributors.

import { core } from "ext:deno_node/_core.ts";
import { validateFunction } from "ext:deno_node/internal/validators.mjs";
import { _exiting } from "ext:deno_node/_process/exiting.ts";
import { FixedQueue } from "ext:deno_node/internal/fixed_queue.ts";

const { core } = globalThis.__bootstrap;

interface Tock {
callback: (...args: Array<unknown>) => void;
args: Array<unknown>;
Expand Down
3 changes: 2 additions & 1 deletion ext/node/polyfills/async_hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
// https://github.com/cloudflare/workerd/blob/77fd0ed6ddba184414f0216508fc62b06e716cab/src/workerd/api/node/async-hooks.c++#L9

import { validateFunction } from "ext:deno_node/internal/validators.mjs";
import { core } from "ext:deno_node/_core.ts";

const { core } = globalThis.__bootstrap;

function assert(cond: boolean) {
if (!cond) throw new Error("Assertion failed");
Expand Down
3 changes: 2 additions & 1 deletion ext/node/polyfills/child_process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

// This module implements 'child_process' module of Node.JS API.
// ref: https://nodejs.org/api/child_process.html
import { core } from "ext:deno_node/_core.ts";
import {
ChildProcess,
ChildProcessOptions,
Expand Down Expand Up @@ -44,6 +43,8 @@ import {
kEmptyObject,
} from "ext:deno_node/internal/util.mjs";

const { core } = globalThis.__bootstrap;

const MAX_BUFFER = 1024 * 1024;

type ForkOptions = ChildProcessOptions;
Expand Down
2 changes: 1 addition & 1 deletion ext/node/polyfills/internal_binding/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

import { core } from "ext:deno_node/_core.ts";
const { core } = globalThis.__bootstrap;

// https://tc39.es/ecma262/#sec-object.prototype.tostring
const _toString = Object.prototype.toString;
Expand Down
2 changes: 1 addition & 1 deletion ext/node/polyfills/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.

const internals = globalThis.__bootstrap.internals;
import { core } from "ext:deno_node/_core.ts";
const { core } = globalThis.__bootstrap;
import { notImplemented, warnNotImplemented } from "ext:deno_node/_utils.ts";
import { EventEmitter } from "ext:deno_node/events.ts";
import { validateString } from "ext:deno_node/internal/validators.mjs";
Expand Down

0 comments on commit f520284

Please sign in to comment.