mirror of
https://github.com/oven-sh/bun
synced 2026-02-03 07:28:53 +00:00
Compare commits
2 Commits
fix-escape
...
repl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7eba3229fe | ||
|
|
5fe13cdaac |
46
src/bun.js/bindings/BunRepl.cpp
Normal file
46
src/bun.js/bindings/BunRepl.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#include "root.h"
|
||||
#include "ScriptExecutionContext.h"
|
||||
#include "JavaScriptCore/JSInternalPromise.h"
|
||||
|
||||
namespace Bun {
|
||||
|
||||
using namespace JSC;
|
||||
using namespace WebCore;
|
||||
|
||||
/*JSC_DEFINE_HOST_FUNCTION(jsFunctionPromiseHandler, (JSC::JSGlobalObject* globalObject, JSC::CallFrame* callFrame)) {
|
||||
return JSValue::encode(jsUndefined());
|
||||
}*/
|
||||
|
||||
extern "C" void Bun__startReplThread(Zig::GlobalObject* replGlobalObject) {
|
||||
JSC::VM& vm = replGlobalObject->vm();
|
||||
JSValue defaultValue = replGlobalObject->internalModuleRegistry()->requireId(replGlobalObject, vm, InternalModuleRegistry::Field::InternalRepl);
|
||||
JSValue startFn = defaultValue.getObject()->getDirect(vm, JSC::Identifier::fromString(vm, "start"_s));
|
||||
JSFunction* replDefaultFn = jsDynamicCast<JSFunction*>(startFn.asCell());
|
||||
|
||||
MarkedArgumentBuffer arguments;
|
||||
//arguments.append(jsNumber(1));
|
||||
JSC::call(replGlobalObject, replDefaultFn, JSC::getCallData(replDefaultFn), JSC::jsUndefined(), arguments);
|
||||
|
||||
// in case we ever need to get a return value from the repl, use this:
|
||||
/*auto returnValue = ^
|
||||
auto* returnCell = returnValue.asCell();
|
||||
if (JSC::JSPromise* promise = JSC::jsDynamicCast<JSC::JSPromise*>(returnCell)) {
|
||||
JSFunction* performPromiseThenFunction = replGlobalObject->performPromiseThenFunction();
|
||||
auto callData = JSC::getCallData(performPromiseThenFunction);
|
||||
ASSERT(callData.type != CallData::Type::None);
|
||||
|
||||
MarkedArgumentBuffer arguments;
|
||||
arguments.append(promise);
|
||||
arguments.append(JSFunction::create(vm, replGlobalObject, 1, String("resolver"_s), jsFunctionPromiseHandler, ImplementationVisibility::Public));
|
||||
arguments.append(JSFunction::create(vm, replGlobalObject, 1, String("rejecter"_s), jsFunctionPromiseHandler, ImplementationVisibility::Public));
|
||||
arguments.append(jsUndefined());
|
||||
arguments.append(jsUndefined()); // "ctx" ?
|
||||
ASSERT(!arguments.hasOverflowed());
|
||||
// async context tracking is handled by performPromiseThenFunction internally.
|
||||
JSC::profiledCall(replGlobalObject, JSC::ProfilingReason::Microtask, performPromiseThenFunction, callData, jsUndefined(), arguments);
|
||||
} else if (JSC::JSInternalPromise* promise = JSC::jsDynamicCast<JSC::JSInternalPromise*>(returnCell)) {
|
||||
RELEASE_ASSERT(false);
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
10
src/cli.zig
10
src/cli.zig
@@ -1099,6 +1099,7 @@ pub const Command = struct {
|
||||
RootCommandMatcher.case("link") => .LinkCommand,
|
||||
RootCommandMatcher.case("unlink") => .UnlinkCommand,
|
||||
RootCommandMatcher.case("x") => .BunxCommand,
|
||||
RootCommandMatcher.case("repl") => .ReplCommand,
|
||||
|
||||
RootCommandMatcher.case("i"), RootCommandMatcher.case("install") => brk: {
|
||||
for (args_iter.buf) |arg| {
|
||||
@@ -1174,6 +1175,7 @@ pub const Command = struct {
|
||||
|
||||
const UpgradeCommand = @import("./cli/upgrade_command.zig").UpgradeCommand;
|
||||
const BunxCommand = @import("./cli/bunx_command.zig").BunxCommand;
|
||||
const ReplCommand = @import("./cli/repl_command.zig").ReplCommand;
|
||||
|
||||
if (comptime bun.fast_debug_build_mode) {
|
||||
// _ = AddCommand;
|
||||
@@ -1276,6 +1278,13 @@ pub const Command = struct {
|
||||
try BunxCommand.exec(ctx);
|
||||
return;
|
||||
},
|
||||
.ReplCommand => {
|
||||
if (comptime bun.fast_debug_build_mode and bun.fast_debug_build_cmd != .ReplCommand) unreachable;
|
||||
const ctx = try Command.Context.create(allocator, log, .ReplCommand);
|
||||
|
||||
try ReplCommand.exec(ctx);
|
||||
return;
|
||||
},
|
||||
.RemoveCommand => {
|
||||
if (comptime bun.fast_debug_build_mode and bun.fast_debug_build_cmd != .RemoveCommand) unreachable;
|
||||
const ctx = try Command.Context.create(allocator, log, .RemoveCommand);
|
||||
@@ -1641,6 +1650,7 @@ pub const Command = struct {
|
||||
InstallCompletionsCommand,
|
||||
LinkCommand,
|
||||
PackageManagerCommand,
|
||||
ReplCommand,
|
||||
RemoveCommand,
|
||||
RunCommand,
|
||||
TestCommand,
|
||||
|
||||
@@ -14,6 +14,8 @@ const open = @import("../open.zig");
|
||||
pub const DiscordCommand = struct {
|
||||
const discord_url: string = "https://bun.sh/discord";
|
||||
pub fn exec(_: std.mem.Allocator) !void {
|
||||
try open.openURL(discord_url);
|
||||
open.openURL(discord_url) catch {
|
||||
Output.println(discord_url, .{});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
73
src/cli/repl_command.zig
Normal file
73
src/cli/repl_command.zig
Normal file
@@ -0,0 +1,73 @@
|
||||
const bun = @import("root").bun;
|
||||
const Output = bun.Output;
|
||||
const Global = bun.Global;
|
||||
const Environment = bun.Environment;
|
||||
const default_allocator = bun.default_allocator;
|
||||
const C = bun.C;
|
||||
const std = @import("std");
|
||||
const JSC = @import("root").bun.JSC;
|
||||
const Api = @import("../api/schema.zig").Api;
|
||||
|
||||
extern "C" fn Bun__startReplThread(*JSC.JSGlobalObject) void;
|
||||
|
||||
pub const ReplCommand = struct {
|
||||
pub fn exec(ctx: bun.CLI.Command.Context) !void {
|
||||
bun.JSC.initialize();
|
||||
startReplThread(ctx);
|
||||
const vm = JSC.VirtualMachine.get();
|
||||
Bun__startReplThread(vm.global);
|
||||
|
||||
vm.eventLoop().tick();
|
||||
while (vm.isEventLoopAlive()) {
|
||||
vm.tick();
|
||||
vm.eventLoop().autoTickActive();
|
||||
}
|
||||
vm.onBeforeExit();
|
||||
|
||||
if (vm.log.msgs.items.len > 0) {
|
||||
if (Output.enable_ansi_colors) {
|
||||
vm.log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), true) catch {};
|
||||
} else {
|
||||
vm.log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), false) catch {};
|
||||
}
|
||||
Output.prettyErrorln("\n", .{});
|
||||
Output.flush();
|
||||
}
|
||||
|
||||
vm.onUnhandledRejection = &onUnhandledRejectionBeforeClose;
|
||||
vm.global.handleRejectedPromises();
|
||||
if (any_unhandled and vm.exit_handler.exit_code == 0) vm.exit_handler.exit_code = 1;
|
||||
const exit_code = vm.exit_handler.exit_code;
|
||||
|
||||
vm.onExit();
|
||||
if (!JSC.is_bindgen) JSC.napi.fixDeadCodeElimination();
|
||||
Global.exit(exit_code);
|
||||
}
|
||||
|
||||
var any_unhandled: bool = false;
|
||||
fn onUnhandledRejectionBeforeClose(this: *JSC.VirtualMachine, _: *JSC.JSGlobalObject, value: JSC.JSValue) void {
|
||||
this.runErrorHandler(value, null);
|
||||
any_unhandled = true;
|
||||
}
|
||||
|
||||
fn startReplThread(ctx: bun.CLI.Command.Context) void {
|
||||
var arena = bun.MimallocArena.init() catch unreachable;
|
||||
Output.Source.configureNamedThread("REPL");
|
||||
//JSC.markBinding(@src());
|
||||
|
||||
var vm = JSC.VirtualMachine.init(.{
|
||||
.allocator = arena.allocator(),
|
||||
.args = std.mem.zeroes(Api.TransformOptions),
|
||||
.store_fd = false,
|
||||
}) catch @panic("Failed to create REPL VM");
|
||||
vm.allocator = arena.allocator();
|
||||
vm.arena = &arena;
|
||||
|
||||
vm.bundler.configureDefines() catch @panic("Failed to configure defines");
|
||||
vm.is_main_thread = true;
|
||||
JSC.VirtualMachine.is_main_thread_vm = true;
|
||||
vm.hide_bun_stackframes = true;
|
||||
vm.argv = ctx.passthrough;
|
||||
vm.eventLoop().ensureWaker();
|
||||
}
|
||||
};
|
||||
423
src/js/internal/repl.ts
Normal file
423
src/js/internal/repl.ts
Normal file
@@ -0,0 +1,423 @@
|
||||
import { type JSC } from '../../../packages/bun-inspector-protocol';
|
||||
const { join } = require('node:path') as typeof import('node:path');
|
||||
const os = require('node:os') as typeof import('node:os');
|
||||
const util = require('node:util') as typeof import('node:util');
|
||||
const readline = require('node:readline/promises') as typeof import('node:readline/promises');
|
||||
const { serve } = Bun;
|
||||
const { exit } = process;
|
||||
|
||||
const { Buffer, WebSocket, Map, EvalError } = globalThis;
|
||||
const Promise: PromiseConstructor<any> = globalThis.Promise; // TS bug?
|
||||
const { isBuffer } = Buffer;
|
||||
const JSONParse = JSON.parse;
|
||||
const JSONStringify = JSON.stringify;
|
||||
const ObjectAssign = Object.assign;
|
||||
const BufferToString = Function.prototype.call.bind(Buffer.prototype.toString) as Primordial<Buffer, 'toString'>;
|
||||
const StringTrim = Function.prototype.call.bind(String.prototype.trim) as Primordial<String, 'trim'>;
|
||||
const StringPrototypeSplit = Function.prototype.call.bind(String.prototype.split) as Primordial<String, 'split'>;
|
||||
const StringPrototypeIncludes = Function.prototype.call.bind(String.prototype.includes) as Primordial<String, 'includes'>;
|
||||
const StringPrototypeReplaceAll = Function.prototype.call.bind(String.prototype.replaceAll) as Primordial<String, 'replaceAll'>;
|
||||
const ArrayPrototypePop = Function.prototype.call.bind(Array.prototype.pop) as Primordial<Array<any>, 'pop'>;
|
||||
const ArrayPrototypeJoin = Function.prototype.call.bind(Array.prototype.join) as Primordial<Array<any>, 'join'>;
|
||||
const MapGet = Function.prototype.call.bind(Map.prototype.get) as Primordial<Map<any, any>, 'get'>;
|
||||
const MapSet = Function.prototype.call.bind(Map.prototype.set) as Primordial<Map<any, any>, 'set'>;
|
||||
const MapDelete = Function.prototype.call.bind(Map.prototype.delete) as Primordial<Map<any, any>, 'delete'>;
|
||||
const console = {
|
||||
log: globalThis.console.log,
|
||||
info: globalThis.console.info,
|
||||
warn: globalThis.console.warn,
|
||||
error: globalThis.console.error,
|
||||
};
|
||||
|
||||
type Primordial<T, M extends keyof T> = <S extends T>(
|
||||
self: S, ...args: Parameters<S[M] extends (...args: any) => any ? S[M] : never>
|
||||
) => ReturnType<S[M] extends (...args: any) => any ? S[M] : never>;
|
||||
type JSCResponsePromiseCallbacks = {
|
||||
resolve: <T extends JSC.ResponseMap[keyof JSC.ResponseMap]>(value: T) => void;
|
||||
reject: (reason: {
|
||||
code?: string | undefined;
|
||||
message: string;
|
||||
}) => void;
|
||||
};
|
||||
type EvalRemoteObject = JSC.Runtime.RemoteObject & { wasAwaited?: boolean; wasThrown?: boolean; };
|
||||
type RemoteObjectType = EvalRemoteObject['type'];
|
||||
type RemoteObjectSubtype = NonNullable<EvalRemoteObject['subtype']>;
|
||||
type TypeofToValueType<T extends RemoteObjectType> =
|
||||
T extends 'string' ? { type: T, value: string; } :
|
||||
T extends 'number' ? { type: T, value: number, description: string; } :
|
||||
T extends 'bigint' ? { type: T, description: string; } :
|
||||
T extends 'boolean' ? { type: T, value: boolean; } :
|
||||
T extends 'symbol' ? { type: T, objectId: string, className: string, description: string; } :
|
||||
T extends 'undefined' ? { type: T; } :
|
||||
T extends 'object' ? { type: T, subtype?: RemoteObjectSubtype, objectId: string, className: string, description: string; } :
|
||||
T extends 'function' ? { type: T, subtype?: RemoteObjectSubtype, objectId: string, className: string, description: string; } : never;
|
||||
type SubtypeofToValueType<T extends RemoteObjectSubtype, BaseObj = { type: 'object', subtype: T, objectId: string, className: string, description: string; }> =
|
||||
T extends 'error' ? BaseObj :
|
||||
T extends 'array' ? BaseObj & { size: number; } :
|
||||
T extends 'null' ? { type: 'object', subtype: T, value: null; } :
|
||||
T extends 'regexp' ? BaseObj :
|
||||
T extends 'date' ? BaseObj :
|
||||
T extends 'map' ? BaseObj & { size: number; } :
|
||||
T extends 'set' ? BaseObj & { size: number; } :
|
||||
T extends 'weakmap' ? BaseObj & { size: number; } :
|
||||
T extends 'weakset' ? BaseObj & { size: number; } :
|
||||
T extends 'iterator' ? never /*//!error*/ :
|
||||
T extends 'class' ? { type: 'function', subtype: T, objectId: string, className: string, description: string, classPrototype: JSC.Runtime.RemoteObject; } :
|
||||
T extends 'proxy' ? BaseObj :
|
||||
T extends 'weakref' ? BaseObj : never;
|
||||
|
||||
/** Convert a {@link WebSocket.onmessage} `event.data` value to a string. */
|
||||
function wsDataToString(data: Parameters<NonNullable<WebSocket['onmessage']>>[0]['data']): string {
|
||||
//if (data instanceof ArrayBuffer) return new TextDecoder('utf-8').decode(data);
|
||||
if (data instanceof Buffer || isBuffer(data)) return BufferToString(data, 'utf-8');
|
||||
else return data;
|
||||
}
|
||||
|
||||
// Note: This is a custom REPLServer, not the Node.js node:repl module one.
|
||||
class REPLServer extends WebSocket {
|
||||
constructor() {
|
||||
const server = serve({
|
||||
inspector: true,
|
||||
development: true,
|
||||
// @ts-expect-error stub
|
||||
fetch() { },
|
||||
});
|
||||
super(`ws://${server.hostname}:${server.port}/bun:inspect`);
|
||||
this.onmessage = (event) => {
|
||||
try {
|
||||
const data = JSONParse(wsDataToString(event.data)) as JSC.Response<keyof JSC.ResponseMap>;
|
||||
const { id } = data;
|
||||
const promiseRef = MapGet(this.#pendingReqs, id);
|
||||
if (promiseRef) {
|
||||
MapDelete(this.#pendingReqs, id);
|
||||
if ('error' in data) promiseRef.reject(data.error);
|
||||
else if ('result' in data) promiseRef.resolve(data.result);
|
||||
else throw `Received response with no result or error: ${id}`;
|
||||
} else throw `Received message for unknown request ID: ${id}`;
|
||||
} catch (err) {
|
||||
console.error(`[ws/message] An unexpected error occured:`, err, '\nReceived Data:', event.data);
|
||||
}
|
||||
};
|
||||
this.onclose = () => console.info('[ws/close] disconnected');
|
||||
this.onerror = (error) => console.error('[ws/error]', error);
|
||||
}
|
||||
|
||||
/** Incrementing current request ID */
|
||||
#reqID = 0;
|
||||
/** Object ID of the global object */
|
||||
#globalObjectID!: string;
|
||||
/** Queue of pending requests promises to resolve, mapped by request ID */
|
||||
readonly #pendingReqs = new Map<number, JSCResponsePromiseCallbacks>();
|
||||
/** Must be awaited before using the REPLServer */
|
||||
readonly ready = new Promise<void>(resolve => {
|
||||
// It's okay to not use primordials here since this only runs once before users can use the REPL
|
||||
this.onopen = () => void this.request('Runtime.enable', {})
|
||||
.then(() => this.rawEval('globalThis'))
|
||||
.then(({ result }) => {
|
||||
this.#globalObjectID = result.objectId!;
|
||||
globalThis._ = undefined;
|
||||
globalThis._error = undefined;
|
||||
Object.defineProperty(globalThis, '#Symbol.for', { value: Symbol.for });
|
||||
Object.defineProperty(globalThis, Symbol.for('#bun.repl.internal'), {
|
||||
value: Object.freeze(Object.defineProperties(Object.create(null), {
|
||||
util: { value: Object.freeze(util) },
|
||||
})),
|
||||
});
|
||||
Object.freeze(globalThis['#bun.repl.internal']);
|
||||
Object.freeze(Promise); // must preserve .name property
|
||||
Object.freeze(Promise.prototype); // too many possible pitfalls
|
||||
//? Workarounds for bug: https://canary.discord.com/channels/876711213126520882/888839314056839309/1120394929164779570
|
||||
const TypedArray = Object.getPrototypeOf(Uint8Array);
|
||||
const wrapIterator = (iterable: Record<string | symbol, any>, key: string | symbol = Symbol.iterator, name = iterable.name + ' Iterator') => {
|
||||
const original = iterable.prototype[key];
|
||||
iterable.prototype[key] = function (...argz: any[]) {
|
||||
const thiz = this;
|
||||
function* wrappedIter() { yield* original.apply(thiz, argz); }
|
||||
return Object.defineProperty(wrappedIter(), Symbol.toStringTag, { value: name, configurable: true });
|
||||
};
|
||||
};
|
||||
wrapIterator(Array);
|
||||
wrapIterator(Array, 'keys');
|
||||
wrapIterator(Array, 'values');
|
||||
wrapIterator(Array, 'entries');
|
||||
wrapIterator(TypedArray, Symbol.iterator, 'Array Iterator');
|
||||
wrapIterator(TypedArray, 'entries', 'Array Iterator');
|
||||
wrapIterator(TypedArray, 'values', 'Array Iterator');
|
||||
wrapIterator(TypedArray, 'keys', 'Array Iterator');
|
||||
wrapIterator(String);
|
||||
wrapIterator(Map);
|
||||
wrapIterator(Map, 'keys');
|
||||
wrapIterator(Map, 'values');
|
||||
wrapIterator(Map, 'entries');
|
||||
wrapIterator(Set);
|
||||
wrapIterator(Set, 'keys');
|
||||
wrapIterator(Set, 'values');
|
||||
wrapIterator(Set, 'entries');
|
||||
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
/** Check and assert typeof for a remote object */
|
||||
typeof<T extends RemoteObjectType>(v: JSC.Runtime.RemoteObject, expected: T):
|
||||
v is Omit<JSC.Runtime.RemoteObject, 'value'> & TypeofToValueType<T> {
|
||||
return v.type === expected;
|
||||
}
|
||||
/** Check and assert subtypeof for a remote object */
|
||||
subtypeof<T extends RemoteObjectSubtype>(v: JSC.Runtime.RemoteObject, expected: T):
|
||||
v is Omit<JSC.Runtime.RemoteObject, 'value'> & SubtypeofToValueType<T> {
|
||||
return v.subtype === expected;
|
||||
}
|
||||
/** Send a direct request to the inspector */
|
||||
request<T extends keyof JSC.RequestMap>(method: T, params: JSC.RequestMap[T]) {
|
||||
const req: JSC.Request<T> = { id: ++this.#reqID, method, params };
|
||||
const response = new Promise<JSC.ResponseMap[T]>((resolve, reject) => {
|
||||
MapSet(this.#pendingReqs, this.#reqID, { resolve: resolve as typeof resolve extends Promise<infer P> ? P : never, reject });
|
||||
}).catch(err => { throw ObjectAssign(new Error, err); });
|
||||
this.send(JSONStringify(req));
|
||||
return response;
|
||||
}
|
||||
/** Direct shortcut for a `Runtime.evaluate` request */
|
||||
async rawEval(code: string): Promise<JSC.Runtime.EvaluateResponse> {
|
||||
return this.request('Runtime.evaluate', {
|
||||
expression: code,
|
||||
generatePreview: true
|
||||
});
|
||||
}
|
||||
/** Run a snippet of code in the REPL */
|
||||
async eval(code: string, topLevelAwaited = false): Promise<string> {
|
||||
const { result, wasThrown } = await this.rawEval(code);
|
||||
let remoteObj: EvalRemoteObject = result;
|
||||
|
||||
switch (result.type) {
|
||||
case 'object': {
|
||||
if (result.subtype === 'null') break;
|
||||
if (!result.objectId) throw new EvalError(`Received non-null object without objectId: ${JSONStringify(result)}`);
|
||||
if (result.className === 'Promise' && topLevelAwaited) {
|
||||
if (!result.preview) throw new EvalError(`Received Promise object without preview: ${JSONStringify(result)}}`);
|
||||
const awaited = await this.request('Runtime.awaitPromise', { promiseObjectId: result.objectId, generatePreview: false });
|
||||
remoteObj = awaited.result;
|
||||
remoteObj.wasAwaited = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
|
||||
const inspected = await this.request('Runtime.callFunctionOn', {
|
||||
objectId: this.#globalObjectID,
|
||||
functionDeclaration: /* js */`(v) => {
|
||||
if (!${wasThrown}) this._ = v;
|
||||
else this._error = v;
|
||||
const { util } = this[this['#Symbol.for']('#bun.repl.internal')];
|
||||
if (${remoteObj.subtype === 'error'}) return Bun.inspect(v, { colors: true });
|
||||
return util.inspect(v, { colors: true }/*util.inspect.replDefaults*/);
|
||||
}`,
|
||||
arguments: [remoteObj],
|
||||
});
|
||||
if (inspected.wasThrown) throw new EvalError(`Failed to inspect object: ${JSONStringify(inspected)}`);
|
||||
if (!this.typeof(inspected.result, 'string')) throw new EvalError(`Received non-string inspect result: ${JSONStringify(inspected)}`);
|
||||
if (wasThrown && remoteObj.subtype !== 'error') return c.red + 'Uncaught ' + c.reset + inspected.result.value;
|
||||
return inspected.result.value;
|
||||
}
|
||||
}
|
||||
|
||||
/** Terminal colors */
|
||||
const c = {
|
||||
bold: '\x1B[1m',
|
||||
dim: '\x1B[2m',
|
||||
underline: '\x1B[4m',
|
||||
/** Not widely supported! */
|
||||
blink: '\x1B[5m',
|
||||
invert: '\x1B[7m',
|
||||
invisible: '\x1B[8m',
|
||||
|
||||
reset: '\x1B[0m',
|
||||
//noBold: '\x1B[21m', (broken)
|
||||
noDim: '\x1B[22m',
|
||||
noUnderline: '\x1B[24m',
|
||||
noBlink: '\x1B[25m',
|
||||
noInvert: '\x1B[27m',
|
||||
visible: '\x1B[28m',
|
||||
|
||||
black: '\x1B[30m',
|
||||
red: '\x1B[31m',
|
||||
green: '\x1B[32m',
|
||||
yellow: '\x1B[33m',
|
||||
blue: '\x1B[34m',
|
||||
purple: '\x1B[35m',
|
||||
cyan: '\x1B[36m',
|
||||
white: '\x1B[37m',
|
||||
gray: '\x1B[90m',
|
||||
redBright: '\x1B[91m',
|
||||
greenBright: '\x1B[92m',
|
||||
yellowBright: '\x1B[93m',
|
||||
blueBright: '\x1B[94m',
|
||||
purpleBright: '\x1B[95m',
|
||||
cyanBright: '\x1B[96m',
|
||||
whiteBright: '\x1B[97m',
|
||||
} as const;
|
||||
/** Terminal background colors */
|
||||
const bg = {
|
||||
black: '\x1B[40m',
|
||||
red: '\x1B[41m',
|
||||
green: '\x1B[42m',
|
||||
yellow: '\x1B[43m',
|
||||
blue: '\x1B[44m',
|
||||
purple: '\x1B[45m',
|
||||
cyan: '\x1B[46m',
|
||||
white: '\x1B[47m',
|
||||
gray: '\x1B[100m',
|
||||
redBright: '\x1B[101m',
|
||||
greenBright: '\x1B[102m',
|
||||
yellowBright: '\x1B[103m',
|
||||
blueBright: '\x1B[104m',
|
||||
purpleBright: '\x1B[105m',
|
||||
cyanBright: '\x1B[106m',
|
||||
whiteBright: '\x1B[107m',
|
||||
} as const;
|
||||
if (!Bun.enableANSIColors) {
|
||||
for (const color in c) Reflect.set(c, color, '');
|
||||
for (const color in bg) Reflect.set(bg, color, '');
|
||||
}
|
||||
|
||||
export default {
|
||||
async start() {
|
||||
try {
|
||||
const repl = new REPLServer();
|
||||
await repl.ready;
|
||||
const history = await loadHistoryData();
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
terminal: true,
|
||||
tabSize: 4,
|
||||
prompt: '> ',
|
||||
historySize: 1000,
|
||||
history: history.lines,
|
||||
// completions currently cause a panic "FilePoll.register failed: 17"
|
||||
//completer(line: string) {
|
||||
// const completions = ['hello', 'world'];
|
||||
// const hits = completions.filter(c => c.startsWith(line));
|
||||
// return [hits.length ? hits : completions, line];
|
||||
//}
|
||||
});
|
||||
// TODO: How to make transpiler not dead-code-eliminate lone constants like "5"?
|
||||
const transpiler = new Bun.Transpiler({
|
||||
target: 'bun',
|
||||
loader: 'ts',
|
||||
minifyWhitespace: false,
|
||||
trimUnusedImports: false,
|
||||
treeShaking: false,
|
||||
inline: false,
|
||||
jsxOptimizationInline: false,
|
||||
});
|
||||
console.log(`Welcome to Bun v${Bun.version}\nType ".help" for more information.`);
|
||||
//* Only primordials should be used beyond this point!
|
||||
rl.on('close', () => {
|
||||
Bun.write(history.path, history.lines.filter(l => l !== '.exit').join('\n'))
|
||||
.catch(() => console.warn(`[!] Failed to save REPL history to ${history.path}!`));
|
||||
console.log(''); // ensure newline
|
||||
exit(0);
|
||||
});
|
||||
rl.on('history', newHistory => {
|
||||
history.lines = newHistory;
|
||||
});
|
||||
rl.prompt();
|
||||
rl.on('line', async line => {
|
||||
line = StringTrim(line);
|
||||
if (!line) return rl.prompt();
|
||||
if (line[0] === '.') {
|
||||
switch (line) {
|
||||
case '.help': {
|
||||
console.log(
|
||||
`Commands & keybinds:\n` +
|
||||
` .help Show this help message.\n` +
|
||||
` .info Print extra REPL information.\n` +
|
||||
` .clear Clear the screen. ${c.gray}(Ctrl+L)${c.reset}\n` +
|
||||
` .exit Exit the REPL. ${c.gray}(Ctrl+C / Ctrl+D)${c.reset}`
|
||||
);
|
||||
} break;
|
||||
case '.info': {
|
||||
console.log(
|
||||
`Bun v${Bun.version} ${c.gray}(${Bun.revision})${c.reset}\n` +
|
||||
` Color mode: ${Bun.enableANSIColors ? `${c.greenBright}Enabled` : 'Disabled'}${c.reset}`
|
||||
);
|
||||
} break;
|
||||
case '.clear': {
|
||||
rl.write(null, { ctrl: true, name: 'l' });
|
||||
} break;
|
||||
case '.exit': {
|
||||
rl.close();
|
||||
} break;
|
||||
default: {
|
||||
console.log(
|
||||
`${c.red}Unknown REPL command "${c.whiteBright}${line}${c.red}", ` +
|
||||
`type "${c.whiteBright}.help${c.red}" for more information.${c.reset}`
|
||||
);
|
||||
} break;
|
||||
}
|
||||
} else {
|
||||
let code: string;
|
||||
try {
|
||||
code = transpiler.transformSync(line);
|
||||
} catch (err) {
|
||||
console.error(err); return;
|
||||
}
|
||||
let hasTLA = false;
|
||||
if (StringPrototypeIncludes(code, 'await')) {
|
||||
hasTLA = true;
|
||||
code = tryProcessTopLevelAwait(code);
|
||||
}
|
||||
console.log(await repl.eval(/* ts */`${code}`, hasTLA));
|
||||
}
|
||||
rl.prompt();
|
||||
});
|
||||
} catch (err) {
|
||||
console.error('Internal REPL Error:');
|
||||
console.error(err, '\nThis should not happen! Search GitHub issues https://bun.sh/issues or ask for #help in https://bun.sh/discord');
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
async function loadHistoryData(): Promise<{ path: string, lines: string[] }> {
|
||||
let out: { path: string; lines: string[]; } | null;
|
||||
if (process.env.XDG_DATA_HOME && (out = await tryLoadHistory(process.env.XDG_DATA_HOME, 'bun'))) return out;
|
||||
else if (process.env.BUN_INSTALL && (out = await tryLoadHistory(process.env.BUN_INSTALL))) return out;
|
||||
else {
|
||||
const homedir = os.homedir();
|
||||
return await tryLoadHistory(homedir) ?? { path: join(homedir, '.bun_repl_history'), lines: [] };
|
||||
}
|
||||
}
|
||||
async function tryLoadHistory(...dir: string[]) {
|
||||
const path = join(...dir, '.bun_repl_history');
|
||||
try {
|
||||
const file = Bun.file(path);
|
||||
if (!await file.exists()) await Bun.write(path, '');
|
||||
return { path, lines: (await file.text()).split('\n') };
|
||||
} catch (err) {
|
||||
//console.log(path, err);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// This only supports the most basic var/let/const declarations
|
||||
const JSVarDeclRegex = /(?<keyword>var|let|const)\s+(?<varname>(?:[$_\p{ID_Start}]|\\u[\da-fA-F]{4})(?:[$\u200C\u200D\p{ID_Continue}]|\\u[\da-fA-F]{4})*)/gu;
|
||||
|
||||
// Wrap the code in an async function if it contains top level await
|
||||
// Make sure to return the result of the last expression
|
||||
function tryProcessTopLevelAwait(src: string) {
|
||||
const lines = StringPrototypeSplit(src, '\n' as any);
|
||||
if (!StringTrim(lines[lines.length - 1])) ArrayPrototypePop(lines);
|
||||
lines[lines.length - 1] = 'return ' + lines[lines.length - 1] + ';})();';
|
||||
lines[0] = '(async()=>{' + lines[0];
|
||||
const transformed = StringPrototypeReplaceAll(ArrayPrototypeJoin(lines, '\n'), JSVarDeclRegex, (m, _1, _2, idx, str, groups) => {
|
||||
const { keyword, varname } = groups;
|
||||
lines[0] = `${keyword === 'const' ? 'let' : keyword} ${varname};${lines[0]}`; // hoist
|
||||
return varname;
|
||||
});
|
||||
//console.info('TLA transform executed:\n', src, '\n>>> to >>>\n', transformed);
|
||||
return transformed;
|
||||
}
|
||||
@@ -18,6 +18,9 @@ JSValue InternalModuleRegistry::createInternalModuleById(JSGlobalObject* globalO
|
||||
case Field::InternalFSCp: {
|
||||
INTERNAL_MODULE_REGISTRY_GENERATE(globalObject, vm, "internal:fs/cp"_s, "internal/fs/cp.js"_s, InternalModuleRegistryConstants::InternalFSCpCode, "builtin://internal/fs/cp"_s);
|
||||
}
|
||||
case Field::InternalRepl: {
|
||||
INTERNAL_MODULE_REGISTRY_GENERATE(globalObject, vm, "internal:repl"_s, "internal/repl.js"_s, InternalModuleRegistryConstants::InternalReplCode, "builtin://internal/repl"_s);
|
||||
}
|
||||
case Field::InternalShared: {
|
||||
INTERNAL_MODULE_REGISTRY_GENERATE(globalObject, vm, "internal:shared"_s, "internal/shared.js"_s, InternalModuleRegistryConstants::InternalSharedCode, "builtin://internal/shared"_s);
|
||||
}
|
||||
|
||||
@@ -3,59 +3,60 @@ BunSqlite = 1,
|
||||
InternalDebugger = 2,
|
||||
InternalFSCpSync = 3,
|
||||
InternalFSCp = 4,
|
||||
InternalShared = 5,
|
||||
NodeAssert = 6,
|
||||
NodeAssertStrict = 7,
|
||||
NodeAsyncHooks = 8,
|
||||
NodeChildProcess = 9,
|
||||
NodeCluster = 10,
|
||||
NodeConsole = 11,
|
||||
NodeCrypto = 12,
|
||||
NodeDgram = 13,
|
||||
NodeDiagnosticsChannel = 14,
|
||||
NodeDNS = 15,
|
||||
NodeDNSPromises = 16,
|
||||
NodeDomain = 17,
|
||||
NodeEvents = 18,
|
||||
NodeFS = 19,
|
||||
NodeFSPromises = 20,
|
||||
NodeHttp = 21,
|
||||
NodeHttp2 = 22,
|
||||
NodeHttps = 23,
|
||||
NodeInspector = 24,
|
||||
NodeNet = 25,
|
||||
NodeOS = 26,
|
||||
NodePathPosix = 27,
|
||||
NodePath = 28,
|
||||
NodePathWin32 = 29,
|
||||
NodePerfHooks = 30,
|
||||
NodePunycode = 31,
|
||||
NodeQuerystring = 32,
|
||||
NodeReadline = 33,
|
||||
NodeReadlinePromises = 34,
|
||||
NodeRepl = 35,
|
||||
NodeStreamConsumers = 36,
|
||||
NodeStream = 37,
|
||||
NodeStreamPromises = 38,
|
||||
NodeStreamWeb = 39,
|
||||
NodeTimers = 40,
|
||||
NodeTimersPromises = 41,
|
||||
NodeTLS = 42,
|
||||
NodeTraceEvents = 43,
|
||||
NodeTty = 44,
|
||||
NodeUrl = 45,
|
||||
NodeUtil = 46,
|
||||
NodeV8 = 47,
|
||||
NodeVM = 48,
|
||||
NodeWasi = 49,
|
||||
NodeWorkerThreads = 50,
|
||||
NodeZlib = 51,
|
||||
ThirdpartyDepd = 52,
|
||||
ThirdpartyDetectLibc = 53,
|
||||
ThirdpartyDetectLibcLinux = 54,
|
||||
ThirdpartyIsomorphicFetch = 55,
|
||||
ThirdpartyNodeFetch = 56,
|
||||
ThirdpartyUndici = 57,
|
||||
ThirdpartyVercelFetch = 58,
|
||||
ThirdpartyWS = 59,
|
||||
InternalRepl = 5,
|
||||
InternalShared = 6,
|
||||
NodeAssert = 7,
|
||||
NodeAssertStrict = 8,
|
||||
NodeAsyncHooks = 9,
|
||||
NodeChildProcess = 10,
|
||||
NodeCluster = 11,
|
||||
NodeConsole = 12,
|
||||
NodeCrypto = 13,
|
||||
NodeDgram = 14,
|
||||
NodeDiagnosticsChannel = 15,
|
||||
NodeDNS = 16,
|
||||
NodeDNSPromises = 17,
|
||||
NodeDomain = 18,
|
||||
NodeEvents = 19,
|
||||
NodeFS = 20,
|
||||
NodeFSPromises = 21,
|
||||
NodeHttp = 22,
|
||||
NodeHttp2 = 23,
|
||||
NodeHttps = 24,
|
||||
NodeInspector = 25,
|
||||
NodeNet = 26,
|
||||
NodeOS = 27,
|
||||
NodePathPosix = 28,
|
||||
NodePath = 29,
|
||||
NodePathWin32 = 30,
|
||||
NodePerfHooks = 31,
|
||||
NodePunycode = 32,
|
||||
NodeQuerystring = 33,
|
||||
NodeReadline = 34,
|
||||
NodeReadlinePromises = 35,
|
||||
NodeRepl = 36,
|
||||
NodeStreamConsumers = 37,
|
||||
NodeStream = 38,
|
||||
NodeStreamPromises = 39,
|
||||
NodeStreamWeb = 40,
|
||||
NodeTimers = 41,
|
||||
NodeTimersPromises = 42,
|
||||
NodeTLS = 43,
|
||||
NodeTraceEvents = 44,
|
||||
NodeTty = 45,
|
||||
NodeUrl = 46,
|
||||
NodeUtil = 47,
|
||||
NodeV8 = 48,
|
||||
NodeVM = 49,
|
||||
NodeWasi = 50,
|
||||
NodeWorkerThreads = 51,
|
||||
NodeZlib = 52,
|
||||
ThirdpartyDepd = 53,
|
||||
ThirdpartyDetectLibc = 54,
|
||||
ThirdpartyDetectLibcLinux = 55,
|
||||
ThirdpartyIsomorphicFetch = 56,
|
||||
ThirdpartyNodeFetch = 57,
|
||||
ThirdpartyUndici = 58,
|
||||
ThirdpartyVercelFetch = 59,
|
||||
ThirdpartyWS = 60,
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define BUN_INTERNAL_MODULE_COUNT 60
|
||||
#define BUN_INTERNAL_MODULE_COUNT 61
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -14,61 +14,62 @@ pub const ResolvedSourceTag = enum(u32) {
|
||||
@"internal:debugger" = 514,
|
||||
@"internal:fs/cp-sync" = 515,
|
||||
@"internal:fs/cp" = 516,
|
||||
@"internal:shared" = 517,
|
||||
@"node:assert" = 518,
|
||||
@"node:assert/strict" = 519,
|
||||
@"node:async_hooks" = 520,
|
||||
@"node:child_process" = 521,
|
||||
@"node:cluster" = 522,
|
||||
@"node:console" = 523,
|
||||
@"node:crypto" = 524,
|
||||
@"node:dgram" = 525,
|
||||
@"node:diagnostics_channel" = 526,
|
||||
@"node:dns" = 527,
|
||||
@"node:dns/promises" = 528,
|
||||
@"node:domain" = 529,
|
||||
@"node:events" = 530,
|
||||
@"node:fs" = 531,
|
||||
@"node:fs/promises" = 532,
|
||||
@"node:http" = 533,
|
||||
@"node:http2" = 534,
|
||||
@"node:https" = 535,
|
||||
@"node:inspector" = 536,
|
||||
@"node:net" = 537,
|
||||
@"node:os" = 538,
|
||||
@"node:path/posix" = 539,
|
||||
@"node:path" = 540,
|
||||
@"node:path/win32" = 541,
|
||||
@"node:perf_hooks" = 542,
|
||||
@"node:punycode" = 543,
|
||||
@"node:querystring" = 544,
|
||||
@"node:readline" = 545,
|
||||
@"node:readline/promises" = 546,
|
||||
@"node:repl" = 547,
|
||||
@"node:stream/consumers" = 548,
|
||||
@"node:stream" = 549,
|
||||
@"node:stream/promises" = 550,
|
||||
@"node:stream/web" = 551,
|
||||
@"node:timers" = 552,
|
||||
@"node:timers/promises" = 553,
|
||||
@"node:tls" = 554,
|
||||
@"node:trace_events" = 555,
|
||||
@"node:tty" = 556,
|
||||
@"node:url" = 557,
|
||||
@"node:util" = 558,
|
||||
@"node:v8" = 559,
|
||||
@"node:vm" = 560,
|
||||
@"node:wasi" = 561,
|
||||
@"node:worker_threads" = 562,
|
||||
@"node:zlib" = 563,
|
||||
@"depd" = 564,
|
||||
@"detect-libc" = 565,
|
||||
@"detect-libc/linux" = 566,
|
||||
@"isomorphic-fetch" = 567,
|
||||
@"node-fetch" = 568,
|
||||
@"undici" = 569,
|
||||
@"vercel_fetch" = 570,
|
||||
@"ws" = 571,
|
||||
@"internal:repl" = 517,
|
||||
@"internal:shared" = 518,
|
||||
@"node:assert" = 519,
|
||||
@"node:assert/strict" = 520,
|
||||
@"node:async_hooks" = 521,
|
||||
@"node:child_process" = 522,
|
||||
@"node:cluster" = 523,
|
||||
@"node:console" = 524,
|
||||
@"node:crypto" = 525,
|
||||
@"node:dgram" = 526,
|
||||
@"node:diagnostics_channel" = 527,
|
||||
@"node:dns" = 528,
|
||||
@"node:dns/promises" = 529,
|
||||
@"node:domain" = 530,
|
||||
@"node:events" = 531,
|
||||
@"node:fs" = 532,
|
||||
@"node:fs/promises" = 533,
|
||||
@"node:http" = 534,
|
||||
@"node:http2" = 535,
|
||||
@"node:https" = 536,
|
||||
@"node:inspector" = 537,
|
||||
@"node:net" = 538,
|
||||
@"node:os" = 539,
|
||||
@"node:path/posix" = 540,
|
||||
@"node:path" = 541,
|
||||
@"node:path/win32" = 542,
|
||||
@"node:perf_hooks" = 543,
|
||||
@"node:punycode" = 544,
|
||||
@"node:querystring" = 545,
|
||||
@"node:readline" = 546,
|
||||
@"node:readline/promises" = 547,
|
||||
@"node:repl" = 548,
|
||||
@"node:stream/consumers" = 549,
|
||||
@"node:stream" = 550,
|
||||
@"node:stream/promises" = 551,
|
||||
@"node:stream/web" = 552,
|
||||
@"node:timers" = 553,
|
||||
@"node:timers/promises" = 554,
|
||||
@"node:tls" = 555,
|
||||
@"node:trace_events" = 556,
|
||||
@"node:tty" = 557,
|
||||
@"node:url" = 558,
|
||||
@"node:util" = 559,
|
||||
@"node:v8" = 560,
|
||||
@"node:vm" = 561,
|
||||
@"node:wasi" = 562,
|
||||
@"node:worker_threads" = 563,
|
||||
@"node:zlib" = 564,
|
||||
@"depd" = 565,
|
||||
@"detect-libc" = 566,
|
||||
@"detect-libc/linux" = 567,
|
||||
@"isomorphic-fetch" = 568,
|
||||
@"node-fetch" = 569,
|
||||
@"undici" = 570,
|
||||
@"vercel_fetch" = 571,
|
||||
@"ws" = 572,
|
||||
// Native modules run through a different system using ESM registry.
|
||||
@"bun" = 1024,
|
||||
@"bun:jsc" = 1025,
|
||||
|
||||
@@ -14,61 +14,62 @@ enum SyntheticModuleType : uint32_t {
|
||||
InternalDebugger = 514,
|
||||
InternalFSCpSync = 515,
|
||||
InternalFSCp = 516,
|
||||
InternalShared = 517,
|
||||
NodeAssert = 518,
|
||||
NodeAssertStrict = 519,
|
||||
NodeAsyncHooks = 520,
|
||||
NodeChildProcess = 521,
|
||||
NodeCluster = 522,
|
||||
NodeConsole = 523,
|
||||
NodeCrypto = 524,
|
||||
NodeDgram = 525,
|
||||
NodeDiagnosticsChannel = 526,
|
||||
NodeDNS = 527,
|
||||
NodeDNSPromises = 528,
|
||||
NodeDomain = 529,
|
||||
NodeEvents = 530,
|
||||
NodeFS = 531,
|
||||
NodeFSPromises = 532,
|
||||
NodeHttp = 533,
|
||||
NodeHttp2 = 534,
|
||||
NodeHttps = 535,
|
||||
NodeInspector = 536,
|
||||
NodeNet = 537,
|
||||
NodeOS = 538,
|
||||
NodePathPosix = 539,
|
||||
NodePath = 540,
|
||||
NodePathWin32 = 541,
|
||||
NodePerfHooks = 542,
|
||||
NodePunycode = 543,
|
||||
NodeQuerystring = 544,
|
||||
NodeReadline = 545,
|
||||
NodeReadlinePromises = 546,
|
||||
NodeRepl = 547,
|
||||
NodeStreamConsumers = 548,
|
||||
NodeStream = 549,
|
||||
NodeStreamPromises = 550,
|
||||
NodeStreamWeb = 551,
|
||||
NodeTimers = 552,
|
||||
NodeTimersPromises = 553,
|
||||
NodeTLS = 554,
|
||||
NodeTraceEvents = 555,
|
||||
NodeTty = 556,
|
||||
NodeUrl = 557,
|
||||
NodeUtil = 558,
|
||||
NodeV8 = 559,
|
||||
NodeVM = 560,
|
||||
NodeWasi = 561,
|
||||
NodeWorkerThreads = 562,
|
||||
NodeZlib = 563,
|
||||
ThirdpartyDepd = 564,
|
||||
ThirdpartyDetectLibc = 565,
|
||||
ThirdpartyDetectLibcLinux = 566,
|
||||
ThirdpartyIsomorphicFetch = 567,
|
||||
ThirdpartyNodeFetch = 568,
|
||||
ThirdpartyUndici = 569,
|
||||
ThirdpartyVercelFetch = 570,
|
||||
ThirdpartyWS = 571,
|
||||
InternalRepl = 517,
|
||||
InternalShared = 518,
|
||||
NodeAssert = 519,
|
||||
NodeAssertStrict = 520,
|
||||
NodeAsyncHooks = 521,
|
||||
NodeChildProcess = 522,
|
||||
NodeCluster = 523,
|
||||
NodeConsole = 524,
|
||||
NodeCrypto = 525,
|
||||
NodeDgram = 526,
|
||||
NodeDiagnosticsChannel = 527,
|
||||
NodeDNS = 528,
|
||||
NodeDNSPromises = 529,
|
||||
NodeDomain = 530,
|
||||
NodeEvents = 531,
|
||||
NodeFS = 532,
|
||||
NodeFSPromises = 533,
|
||||
NodeHttp = 534,
|
||||
NodeHttp2 = 535,
|
||||
NodeHttps = 536,
|
||||
NodeInspector = 537,
|
||||
NodeNet = 538,
|
||||
NodeOS = 539,
|
||||
NodePathPosix = 540,
|
||||
NodePath = 541,
|
||||
NodePathWin32 = 542,
|
||||
NodePerfHooks = 543,
|
||||
NodePunycode = 544,
|
||||
NodeQuerystring = 545,
|
||||
NodeReadline = 546,
|
||||
NodeReadlinePromises = 547,
|
||||
NodeRepl = 548,
|
||||
NodeStreamConsumers = 549,
|
||||
NodeStream = 550,
|
||||
NodeStreamPromises = 551,
|
||||
NodeStreamWeb = 552,
|
||||
NodeTimers = 553,
|
||||
NodeTimersPromises = 554,
|
||||
NodeTLS = 555,
|
||||
NodeTraceEvents = 556,
|
||||
NodeTty = 557,
|
||||
NodeUrl = 558,
|
||||
NodeUtil = 559,
|
||||
NodeV8 = 560,
|
||||
NodeVM = 561,
|
||||
NodeWasi = 562,
|
||||
NodeWorkerThreads = 563,
|
||||
NodeZlib = 564,
|
||||
ThirdpartyDepd = 565,
|
||||
ThirdpartyDetectLibc = 566,
|
||||
ThirdpartyDetectLibcLinux = 567,
|
||||
ThirdpartyIsomorphicFetch = 568,
|
||||
ThirdpartyNodeFetch = 569,
|
||||
ThirdpartyUndici = 570,
|
||||
ThirdpartyVercelFetch = 571,
|
||||
ThirdpartyWS = 572,
|
||||
|
||||
// Native modules run through the same system, but with different underlying initializers.
|
||||
// They also have bit 10 set to differentiate them from JS builtins.
|
||||
|
||||
3672
src/js/out/WebCoreJSBuiltins.cpp
generated
3672
src/js/out/WebCoreJSBuiltins.cpp
generated
File diff suppressed because one or more lines are too long
250
src/js/out/WebCoreJSBuiltins.d.ts
generated
vendored
250
src/js/out/WebCoreJSBuiltins.d.ts
generated
vendored
@@ -2,6 +2,131 @@
|
||||
// Do not edit by hand.
|
||||
type RemoveThis<F> = F extends (this: infer T, ...args: infer A) => infer R ? (...args: A) => R : F;
|
||||
|
||||
// ReadableByteStreamInternals.ts
|
||||
declare const $privateInitializeReadableByteStreamController: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["privateInitializeReadableByteStreamController"]>;
|
||||
declare const $readableStreamByteStreamControllerStart: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamByteStreamControllerStart"]>;
|
||||
declare const $privateInitializeReadableStreamBYOBRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["privateInitializeReadableStreamBYOBRequest"]>;
|
||||
declare const $isReadableByteStreamController: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["isReadableByteStreamController"]>;
|
||||
declare const $isReadableStreamBYOBRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["isReadableStreamBYOBRequest"]>;
|
||||
declare const $isReadableStreamBYOBReader: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["isReadableStreamBYOBReader"]>;
|
||||
declare const $readableByteStreamControllerCancel: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerCancel"]>;
|
||||
declare const $readableByteStreamControllerError: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerError"]>;
|
||||
declare const $readableByteStreamControllerClose: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerClose"]>;
|
||||
declare const $readableByteStreamControllerClearPendingPullIntos: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerClearPendingPullIntos"]>;
|
||||
declare const $readableByteStreamControllerGetDesiredSize: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerGetDesiredSize"]>;
|
||||
declare const $readableStreamHasBYOBReader: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamHasBYOBReader"]>;
|
||||
declare const $readableStreamHasDefaultReader: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamHasDefaultReader"]>;
|
||||
declare const $readableByteStreamControllerHandleQueueDrain: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerHandleQueueDrain"]>;
|
||||
declare const $readableByteStreamControllerPull: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerPull"]>;
|
||||
declare const $readableByteStreamControllerShouldCallPull: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerShouldCallPull"]>;
|
||||
declare const $readableByteStreamControllerCallPullIfNeeded: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerCallPullIfNeeded"]>;
|
||||
declare const $transferBufferToCurrentRealm: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["transferBufferToCurrentRealm"]>;
|
||||
declare const $readableStreamReaderKind: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamReaderKind"]>;
|
||||
declare const $readableByteStreamControllerEnqueue: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerEnqueue"]>;
|
||||
declare const $readableByteStreamControllerEnqueueChunk: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerEnqueueChunk"]>;
|
||||
declare const $readableByteStreamControllerRespondWithNewView: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondWithNewView"]>;
|
||||
declare const $readableByteStreamControllerRespond: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespond"]>;
|
||||
declare const $readableByteStreamControllerRespondInternal: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondInternal"]>;
|
||||
declare const $readableByteStreamControllerRespondInReadableState: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondInReadableState"]>;
|
||||
declare const $readableByteStreamControllerRespondInClosedState: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondInClosedState"]>;
|
||||
declare const $readableByteStreamControllerProcessPullDescriptors: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerProcessPullDescriptors"]>;
|
||||
declare const $readableByteStreamControllerFillDescriptorFromQueue: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerFillDescriptorFromQueue"]>;
|
||||
declare const $readableByteStreamControllerShiftPendingDescriptor: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerShiftPendingDescriptor"]>;
|
||||
declare const $readableByteStreamControllerInvalidateBYOBRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerInvalidateBYOBRequest"]>;
|
||||
declare const $readableByteStreamControllerCommitDescriptor: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerCommitDescriptor"]>;
|
||||
declare const $readableByteStreamControllerConvertDescriptor: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerConvertDescriptor"]>;
|
||||
declare const $readableStreamFulfillReadIntoRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamFulfillReadIntoRequest"]>;
|
||||
declare const $readableStreamBYOBReaderRead: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamBYOBReaderRead"]>;
|
||||
declare const $readableByteStreamControllerPullInto: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerPullInto"]>;
|
||||
declare const $readableStreamAddReadIntoRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamAddReadIntoRequest"]>;
|
||||
|
||||
// StreamInternals.ts
|
||||
declare const $markPromiseAsHandled: RemoveThis<typeof import("../builtins/StreamInternals")["markPromiseAsHandled"]>;
|
||||
declare const $shieldingPromiseResolve: RemoveThis<typeof import("../builtins/StreamInternals")["shieldingPromiseResolve"]>;
|
||||
declare const $promiseInvokeOrNoopMethodNoCatch: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoopMethodNoCatch"]>;
|
||||
declare const $promiseInvokeOrNoopNoCatch: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoopNoCatch"]>;
|
||||
declare const $promiseInvokeOrNoopMethod: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoopMethod"]>;
|
||||
declare const $promiseInvokeOrNoop: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoop"]>;
|
||||
declare const $promiseInvokeOrFallbackOrNoop: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrFallbackOrNoop"]>;
|
||||
declare const $validateAndNormalizeQueuingStrategy: RemoveThis<typeof import("../builtins/StreamInternals")["validateAndNormalizeQueuingStrategy"]>;
|
||||
declare const $createFIFO: RemoveThis<typeof import("../builtins/StreamInternals")["createFIFO"]>;
|
||||
declare const $newQueue: RemoveThis<typeof import("../builtins/StreamInternals")["newQueue"]>;
|
||||
declare const $dequeueValue: RemoveThis<typeof import("../builtins/StreamInternals")["dequeueValue"]>;
|
||||
declare const $enqueueValueWithSize: RemoveThis<typeof import("../builtins/StreamInternals")["enqueueValueWithSize"]>;
|
||||
declare const $peekQueueValue: RemoveThis<typeof import("../builtins/StreamInternals")["peekQueueValue"]>;
|
||||
declare const $resetQueue: RemoveThis<typeof import("../builtins/StreamInternals")["resetQueue"]>;
|
||||
declare const $extractSizeAlgorithm: RemoveThis<typeof import("../builtins/StreamInternals")["extractSizeAlgorithm"]>;
|
||||
declare const $extractHighWaterMark: RemoveThis<typeof import("../builtins/StreamInternals")["extractHighWaterMark"]>;
|
||||
declare const $extractHighWaterMarkFromQueuingStrategyInit: RemoveThis<typeof import("../builtins/StreamInternals")["extractHighWaterMarkFromQueuingStrategyInit"]>;
|
||||
declare const $createFulfilledPromise: RemoveThis<typeof import("../builtins/StreamInternals")["createFulfilledPromise"]>;
|
||||
declare const $toDictionary: RemoveThis<typeof import("../builtins/StreamInternals")["toDictionary"]>;
|
||||
|
||||
// ReadableStreamInternals.ts
|
||||
declare const $readableStreamReaderGenericInitialize: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamReaderGenericInitialize"]>;
|
||||
declare const $privateInitializeReadableStreamDefaultController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["privateInitializeReadableStreamDefaultController"]>;
|
||||
declare const $readableStreamDefaultControllerError: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerError"]>;
|
||||
declare const $readableStreamPipeTo: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamPipeTo"]>;
|
||||
declare const $acquireReadableStreamDefaultReader: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["acquireReadableStreamDefaultReader"]>;
|
||||
declare const $setupReadableStreamDefaultController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["setupReadableStreamDefaultController"]>;
|
||||
declare const $createReadableStreamController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["createReadableStreamController"]>;
|
||||
declare const $readableStreamDefaultControllerStart: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerStart"]>;
|
||||
declare const $readableStreamPipeToWritableStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamPipeToWritableStream"]>;
|
||||
declare const $pipeToLoop: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToLoop"]>;
|
||||
declare const $pipeToDoReadWrite: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToDoReadWrite"]>;
|
||||
declare const $pipeToErrorsMustBePropagatedForward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToErrorsMustBePropagatedForward"]>;
|
||||
declare const $pipeToErrorsMustBePropagatedBackward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToErrorsMustBePropagatedBackward"]>;
|
||||
declare const $pipeToClosingMustBePropagatedForward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToClosingMustBePropagatedForward"]>;
|
||||
declare const $pipeToClosingMustBePropagatedBackward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToClosingMustBePropagatedBackward"]>;
|
||||
declare const $pipeToShutdownWithAction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToShutdownWithAction"]>;
|
||||
declare const $pipeToShutdown: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToShutdown"]>;
|
||||
declare const $pipeToFinalize: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToFinalize"]>;
|
||||
declare const $readableStreamTee: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTee"]>;
|
||||
declare const $readableStreamTeePullFunction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTeePullFunction"]>;
|
||||
declare const $readableStreamTeeBranch1CancelFunction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTeeBranch1CancelFunction"]>;
|
||||
declare const $readableStreamTeeBranch2CancelFunction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTeeBranch2CancelFunction"]>;
|
||||
declare const $isReadableStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStream"]>;
|
||||
declare const $isReadableStreamDefaultReader: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamDefaultReader"]>;
|
||||
declare const $isReadableStreamDefaultController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamDefaultController"]>;
|
||||
declare const $readDirectStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readDirectStream"]>;
|
||||
declare const $assignToStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["assignToStream"]>;
|
||||
declare const $readStreamIntoSink: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readStreamIntoSink"]>;
|
||||
declare const $handleDirectStreamError: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["handleDirectStreamError"]>;
|
||||
declare const $handleDirectStreamErrorReject: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["handleDirectStreamErrorReject"]>;
|
||||
declare const $onPullDirectStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["onPullDirectStream"]>;
|
||||
declare const $noopDoneFunction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["noopDoneFunction"]>;
|
||||
declare const $onReadableStreamDirectControllerClosed: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["onReadableStreamDirectControllerClosed"]>;
|
||||
declare const $onCloseDirectStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["onCloseDirectStream"]>;
|
||||
declare const $onFlushDirectStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["onFlushDirectStream"]>;
|
||||
declare const $createTextStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["createTextStream"]>;
|
||||
declare const $initializeTextStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["initializeTextStream"]>;
|
||||
declare const $initializeArrayStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["initializeArrayStream"]>;
|
||||
declare const $initializeArrayBufferStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["initializeArrayBufferStream"]>;
|
||||
declare const $readableStreamError: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamError"]>;
|
||||
declare const $readableStreamDefaultControllerShouldCallPull: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerShouldCallPull"]>;
|
||||
declare const $readableStreamDefaultControllerCallPullIfNeeded: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerCallPullIfNeeded"]>;
|
||||
declare const $isReadableStreamLocked: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamLocked"]>;
|
||||
declare const $readableStreamDefaultControllerGetDesiredSize: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerGetDesiredSize"]>;
|
||||
declare const $readableStreamReaderGenericCancel: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamReaderGenericCancel"]>;
|
||||
declare const $readableStreamCancel: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamCancel"]>;
|
||||
declare const $readableStreamDefaultControllerCancel: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerCancel"]>;
|
||||
declare const $readableStreamDefaultControllerPull: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerPull"]>;
|
||||
declare const $readableStreamDefaultControllerClose: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerClose"]>;
|
||||
declare const $readableStreamClose: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamClose"]>;
|
||||
declare const $readableStreamFulfillReadRequest: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamFulfillReadRequest"]>;
|
||||
declare const $readableStreamDefaultControllerEnqueue: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerEnqueue"]>;
|
||||
declare const $readableStreamDefaultReaderRead: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultReaderRead"]>;
|
||||
declare const $readableStreamAddReadRequest: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamAddReadRequest"]>;
|
||||
declare const $isReadableStreamDisturbed: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamDisturbed"]>;
|
||||
declare const $readableStreamReaderGenericRelease: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamReaderGenericRelease"]>;
|
||||
declare const $readableStreamDefaultControllerCanCloseOrEnqueue: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerCanCloseOrEnqueue"]>;
|
||||
declare const $lazyLoadStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["lazyLoadStream"]>;
|
||||
declare const $readableStreamIntoArray: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamIntoArray"]>;
|
||||
declare const $readableStreamIntoText: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamIntoText"]>;
|
||||
declare const $readableStreamToArrayBufferDirect: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamToArrayBufferDirect"]>;
|
||||
declare const $readableStreamToTextDirect: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamToTextDirect"]>;
|
||||
declare const $readableStreamToArrayDirect: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamToArrayDirect"]>;
|
||||
declare const $readableStreamDefineLazyIterators: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefineLazyIterators"]>;
|
||||
|
||||
// WritableStreamInternals.ts
|
||||
declare const $isWritableStream: RemoveThis<typeof import("../builtins/WritableStreamInternals")["isWritableStream"]>;
|
||||
declare const $isWritableStreamDefaultWriter: RemoveThis<typeof import("../builtins/WritableStreamInternals")["isWritableStreamDefaultWriter"]>;
|
||||
@@ -72,128 +197,3 @@ declare const $transformStreamDefaultSinkWriteAlgorithm: RemoveThis<typeof impor
|
||||
declare const $transformStreamDefaultSinkAbortAlgorithm: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultSinkAbortAlgorithm"]>;
|
||||
declare const $transformStreamDefaultSinkCloseAlgorithm: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultSinkCloseAlgorithm"]>;
|
||||
declare const $transformStreamDefaultSourcePullAlgorithm: RemoveThis<typeof import("../builtins/TransformStreamInternals")["transformStreamDefaultSourcePullAlgorithm"]>;
|
||||
|
||||
// ReadableStreamInternals.ts
|
||||
declare const $readableStreamReaderGenericInitialize: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamReaderGenericInitialize"]>;
|
||||
declare const $privateInitializeReadableStreamDefaultController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["privateInitializeReadableStreamDefaultController"]>;
|
||||
declare const $readableStreamDefaultControllerError: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerError"]>;
|
||||
declare const $readableStreamPipeTo: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamPipeTo"]>;
|
||||
declare const $acquireReadableStreamDefaultReader: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["acquireReadableStreamDefaultReader"]>;
|
||||
declare const $setupReadableStreamDefaultController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["setupReadableStreamDefaultController"]>;
|
||||
declare const $createReadableStreamController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["createReadableStreamController"]>;
|
||||
declare const $readableStreamDefaultControllerStart: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerStart"]>;
|
||||
declare const $readableStreamPipeToWritableStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamPipeToWritableStream"]>;
|
||||
declare const $pipeToLoop: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToLoop"]>;
|
||||
declare const $pipeToDoReadWrite: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToDoReadWrite"]>;
|
||||
declare const $pipeToErrorsMustBePropagatedForward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToErrorsMustBePropagatedForward"]>;
|
||||
declare const $pipeToErrorsMustBePropagatedBackward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToErrorsMustBePropagatedBackward"]>;
|
||||
declare const $pipeToClosingMustBePropagatedForward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToClosingMustBePropagatedForward"]>;
|
||||
declare const $pipeToClosingMustBePropagatedBackward: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToClosingMustBePropagatedBackward"]>;
|
||||
declare const $pipeToShutdownWithAction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToShutdownWithAction"]>;
|
||||
declare const $pipeToShutdown: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToShutdown"]>;
|
||||
declare const $pipeToFinalize: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["pipeToFinalize"]>;
|
||||
declare const $readableStreamTee: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTee"]>;
|
||||
declare const $readableStreamTeePullFunction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTeePullFunction"]>;
|
||||
declare const $readableStreamTeeBranch1CancelFunction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTeeBranch1CancelFunction"]>;
|
||||
declare const $readableStreamTeeBranch2CancelFunction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamTeeBranch2CancelFunction"]>;
|
||||
declare const $isReadableStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStream"]>;
|
||||
declare const $isReadableStreamDefaultReader: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamDefaultReader"]>;
|
||||
declare const $isReadableStreamDefaultController: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamDefaultController"]>;
|
||||
declare const $readDirectStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readDirectStream"]>;
|
||||
declare const $assignToStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["assignToStream"]>;
|
||||
declare const $readStreamIntoSink: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readStreamIntoSink"]>;
|
||||
declare const $handleDirectStreamError: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["handleDirectStreamError"]>;
|
||||
declare const $handleDirectStreamErrorReject: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["handleDirectStreamErrorReject"]>;
|
||||
declare const $onPullDirectStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["onPullDirectStream"]>;
|
||||
declare const $noopDoneFunction: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["noopDoneFunction"]>;
|
||||
declare const $onReadableStreamDirectControllerClosed: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["onReadableStreamDirectControllerClosed"]>;
|
||||
declare const $onCloseDirectStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["onCloseDirectStream"]>;
|
||||
declare const $onFlushDirectStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["onFlushDirectStream"]>;
|
||||
declare const $createTextStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["createTextStream"]>;
|
||||
declare const $initializeTextStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["initializeTextStream"]>;
|
||||
declare const $initializeArrayStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["initializeArrayStream"]>;
|
||||
declare const $initializeArrayBufferStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["initializeArrayBufferStream"]>;
|
||||
declare const $readableStreamError: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamError"]>;
|
||||
declare const $readableStreamDefaultControllerShouldCallPull: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerShouldCallPull"]>;
|
||||
declare const $readableStreamDefaultControllerCallPullIfNeeded: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerCallPullIfNeeded"]>;
|
||||
declare const $isReadableStreamLocked: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamLocked"]>;
|
||||
declare const $readableStreamDefaultControllerGetDesiredSize: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerGetDesiredSize"]>;
|
||||
declare const $readableStreamReaderGenericCancel: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamReaderGenericCancel"]>;
|
||||
declare const $readableStreamCancel: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamCancel"]>;
|
||||
declare const $readableStreamDefaultControllerCancel: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerCancel"]>;
|
||||
declare const $readableStreamDefaultControllerPull: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerPull"]>;
|
||||
declare const $readableStreamDefaultControllerClose: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerClose"]>;
|
||||
declare const $readableStreamClose: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamClose"]>;
|
||||
declare const $readableStreamFulfillReadRequest: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamFulfillReadRequest"]>;
|
||||
declare const $readableStreamDefaultControllerEnqueue: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerEnqueue"]>;
|
||||
declare const $readableStreamDefaultReaderRead: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultReaderRead"]>;
|
||||
declare const $readableStreamAddReadRequest: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamAddReadRequest"]>;
|
||||
declare const $isReadableStreamDisturbed: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["isReadableStreamDisturbed"]>;
|
||||
declare const $readableStreamReaderGenericRelease: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamReaderGenericRelease"]>;
|
||||
declare const $readableStreamDefaultControllerCanCloseOrEnqueue: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefaultControllerCanCloseOrEnqueue"]>;
|
||||
declare const $lazyLoadStream: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["lazyLoadStream"]>;
|
||||
declare const $readableStreamIntoArray: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamIntoArray"]>;
|
||||
declare const $readableStreamIntoText: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamIntoText"]>;
|
||||
declare const $readableStreamToArrayBufferDirect: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamToArrayBufferDirect"]>;
|
||||
declare const $readableStreamToTextDirect: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamToTextDirect"]>;
|
||||
declare const $readableStreamToArrayDirect: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamToArrayDirect"]>;
|
||||
declare const $readableStreamDefineLazyIterators: RemoveThis<typeof import("../builtins/ReadableStreamInternals")["readableStreamDefineLazyIterators"]>;
|
||||
|
||||
// StreamInternals.ts
|
||||
declare const $markPromiseAsHandled: RemoveThis<typeof import("../builtins/StreamInternals")["markPromiseAsHandled"]>;
|
||||
declare const $shieldingPromiseResolve: RemoveThis<typeof import("../builtins/StreamInternals")["shieldingPromiseResolve"]>;
|
||||
declare const $promiseInvokeOrNoopMethodNoCatch: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoopMethodNoCatch"]>;
|
||||
declare const $promiseInvokeOrNoopNoCatch: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoopNoCatch"]>;
|
||||
declare const $promiseInvokeOrNoopMethod: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoopMethod"]>;
|
||||
declare const $promiseInvokeOrNoop: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrNoop"]>;
|
||||
declare const $promiseInvokeOrFallbackOrNoop: RemoveThis<typeof import("../builtins/StreamInternals")["promiseInvokeOrFallbackOrNoop"]>;
|
||||
declare const $validateAndNormalizeQueuingStrategy: RemoveThis<typeof import("../builtins/StreamInternals")["validateAndNormalizeQueuingStrategy"]>;
|
||||
declare const $createFIFO: RemoveThis<typeof import("../builtins/StreamInternals")["createFIFO"]>;
|
||||
declare const $newQueue: RemoveThis<typeof import("../builtins/StreamInternals")["newQueue"]>;
|
||||
declare const $dequeueValue: RemoveThis<typeof import("../builtins/StreamInternals")["dequeueValue"]>;
|
||||
declare const $enqueueValueWithSize: RemoveThis<typeof import("../builtins/StreamInternals")["enqueueValueWithSize"]>;
|
||||
declare const $peekQueueValue: RemoveThis<typeof import("../builtins/StreamInternals")["peekQueueValue"]>;
|
||||
declare const $resetQueue: RemoveThis<typeof import("../builtins/StreamInternals")["resetQueue"]>;
|
||||
declare const $extractSizeAlgorithm: RemoveThis<typeof import("../builtins/StreamInternals")["extractSizeAlgorithm"]>;
|
||||
declare const $extractHighWaterMark: RemoveThis<typeof import("../builtins/StreamInternals")["extractHighWaterMark"]>;
|
||||
declare const $extractHighWaterMarkFromQueuingStrategyInit: RemoveThis<typeof import("../builtins/StreamInternals")["extractHighWaterMarkFromQueuingStrategyInit"]>;
|
||||
declare const $createFulfilledPromise: RemoveThis<typeof import("../builtins/StreamInternals")["createFulfilledPromise"]>;
|
||||
declare const $toDictionary: RemoveThis<typeof import("../builtins/StreamInternals")["toDictionary"]>;
|
||||
|
||||
// ReadableByteStreamInternals.ts
|
||||
declare const $privateInitializeReadableByteStreamController: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["privateInitializeReadableByteStreamController"]>;
|
||||
declare const $readableStreamByteStreamControllerStart: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamByteStreamControllerStart"]>;
|
||||
declare const $privateInitializeReadableStreamBYOBRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["privateInitializeReadableStreamBYOBRequest"]>;
|
||||
declare const $isReadableByteStreamController: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["isReadableByteStreamController"]>;
|
||||
declare const $isReadableStreamBYOBRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["isReadableStreamBYOBRequest"]>;
|
||||
declare const $isReadableStreamBYOBReader: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["isReadableStreamBYOBReader"]>;
|
||||
declare const $readableByteStreamControllerCancel: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerCancel"]>;
|
||||
declare const $readableByteStreamControllerError: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerError"]>;
|
||||
declare const $readableByteStreamControllerClose: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerClose"]>;
|
||||
declare const $readableByteStreamControllerClearPendingPullIntos: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerClearPendingPullIntos"]>;
|
||||
declare const $readableByteStreamControllerGetDesiredSize: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerGetDesiredSize"]>;
|
||||
declare const $readableStreamHasBYOBReader: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamHasBYOBReader"]>;
|
||||
declare const $readableStreamHasDefaultReader: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamHasDefaultReader"]>;
|
||||
declare const $readableByteStreamControllerHandleQueueDrain: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerHandleQueueDrain"]>;
|
||||
declare const $readableByteStreamControllerPull: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerPull"]>;
|
||||
declare const $readableByteStreamControllerShouldCallPull: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerShouldCallPull"]>;
|
||||
declare const $readableByteStreamControllerCallPullIfNeeded: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerCallPullIfNeeded"]>;
|
||||
declare const $transferBufferToCurrentRealm: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["transferBufferToCurrentRealm"]>;
|
||||
declare const $readableStreamReaderKind: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamReaderKind"]>;
|
||||
declare const $readableByteStreamControllerEnqueue: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerEnqueue"]>;
|
||||
declare const $readableByteStreamControllerEnqueueChunk: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerEnqueueChunk"]>;
|
||||
declare const $readableByteStreamControllerRespondWithNewView: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondWithNewView"]>;
|
||||
declare const $readableByteStreamControllerRespond: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespond"]>;
|
||||
declare const $readableByteStreamControllerRespondInternal: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondInternal"]>;
|
||||
declare const $readableByteStreamControllerRespondInReadableState: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondInReadableState"]>;
|
||||
declare const $readableByteStreamControllerRespondInClosedState: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerRespondInClosedState"]>;
|
||||
declare const $readableByteStreamControllerProcessPullDescriptors: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerProcessPullDescriptors"]>;
|
||||
declare const $readableByteStreamControllerFillDescriptorFromQueue: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerFillDescriptorFromQueue"]>;
|
||||
declare const $readableByteStreamControllerShiftPendingDescriptor: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerShiftPendingDescriptor"]>;
|
||||
declare const $readableByteStreamControllerInvalidateBYOBRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerInvalidateBYOBRequest"]>;
|
||||
declare const $readableByteStreamControllerCommitDescriptor: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerCommitDescriptor"]>;
|
||||
declare const $readableByteStreamControllerConvertDescriptor: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerConvertDescriptor"]>;
|
||||
declare const $readableStreamFulfillReadIntoRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamFulfillReadIntoRequest"]>;
|
||||
declare const $readableStreamBYOBReaderRead: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamBYOBReaderRead"]>;
|
||||
declare const $readableByteStreamControllerPullInto: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableByteStreamControllerPullInto"]>;
|
||||
declare const $readableStreamAddReadIntoRequest: RemoveThis<typeof import("../builtins/ReadableByteStreamInternals")["readableStreamAddReadIntoRequest"]>;
|
||||
|
||||
7194
src/js/out/WebCoreJSBuiltins.h
generated
7194
src/js/out/WebCoreJSBuiltins.h
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user