Compare commits

...

1 Commits

Author SHA1 Message Date
Jarred Sumner
c02cec3f37 Set a null prototype for most of the internals 2025-01-20 21:25:55 -08:00
55 changed files with 59 additions and 8 deletions

View File

@@ -582,4 +582,5 @@ export default {
toBuffer,
viewSource,
cc,
__proto__: null,
};

View File

@@ -607,4 +607,5 @@ export default {
constants,
default: Database,
SQLiteError,
__proto__: null,
};

View File

@@ -30,4 +30,5 @@ function addAbortListener(signal: AbortSignal, listener: EventListener): Disposa
export default {
addAbortListener,
__proto__: null,
};

View File

@@ -108,4 +108,4 @@ function printMyersDiff(diff: Diff[], simple = false) {
return { message: `\n${message}`, skipped };
}
export default { myersDiff, printMyersDiff, printSimpleMyersDiff };
export default { myersDiff, printMyersDiff, printSimpleMyersDiff, __proto__: null };

View File

@@ -1,4 +1,5 @@
// tiny module to shortcut getting access to this boolean without loading the entire node:cluster module
export default {
isPrimary: Bun.env.NODE_UNIQUE_ID == null,
__proto__: null,
};

View File

@@ -19,4 +19,5 @@ function aggregateTwoErrors(innerError, outerError) {
export default {
aggregateTwoErrors,
__proto__: null,
};

View File

@@ -124,4 +124,5 @@ class FixedQueue<T> {
export default {
FixedCircularBuffer,
FixedQueue,
__proto__: null,
};

View File

@@ -1,3 +1,3 @@
const [addServerName, upgradeDuplexToTLS, isNamedPipeSocket] = $zig("socket.zig", "createNodeTLSBinding");
export default { addServerName, upgradeDuplexToTLS, isNamedPipeSocket };
export default { addServerName, upgradeDuplexToTLS, isNamedPipeSocket, __proto__: null };

View File

@@ -102,4 +102,5 @@ export default {
defineCustomPromisify,
defineCustomPromisifyArgs,
promisify,
__proto__: null,
};

View File

@@ -106,6 +106,7 @@ export default {
fileSinkSymbol,
ExceptionWithHostPort,
once,
__proto__: null,
kHandle: Symbol("kHandle"),
kAutoDestroyed: Symbol("kAutoDestroyed"),

View File

@@ -42,4 +42,5 @@ function pipeline(...streams) {
export default {
finished,
pipeline,
__proto__: null,
};

View File

@@ -46,6 +46,7 @@ function addAbortSignalNoValidate(signal, stream) {
}
export default {
__proto__: null,
addAbortSignal,
addAbortSignalNoValidate,
};

View File

@@ -332,6 +332,7 @@ function destroyer(stream, err) {
}
export default {
__proto__: null,
construct,
destroyer,
destroy,

View File

@@ -113,4 +113,4 @@ function prependListener(emitter, event, fn) {
else emitter._events[event] = [fn, emitter._events[event]];
}
export default { Stream, prependListener };
export default { Stream, prependListener, __proto__: null };

View File

@@ -391,6 +391,7 @@ function take(number, options?: { signal: AbortSignal }) {
ObjectDefineProperty(take, "length", { value: 1 });
export default {
__proto__: null,
streamReturningOperators: {
drop,
filter,

View File

@@ -445,4 +445,4 @@ function pipe(src, dst, finish, finishOnlyHandleError, { end }) {
return eos(dst, { readable: false, writable: true }, finish);
}
export default { pipelineImpl, pipeline };
export default { pipelineImpl, pipeline, __proto__: null };

View File

@@ -41,6 +41,7 @@ function getHighWaterMark(state, options, duplexKey, isDuplex) {
}
export default {
__proto__: null,
getHighWaterMark,
getDefaultHighWaterMark,
setDefaultHighWaterMark,

View File

@@ -171,4 +171,4 @@ function getColorDepth(env: NodeJS.ProcessEnv) {
return COLORS_2;
}
export default { getColorDepth };
export default { getColorDepth, __proto__: null };

View File

@@ -20,4 +20,5 @@ function urlToHttpOptions(url) {
export default {
urlToHttpOptions,
__proto__: null,
};

View File

@@ -2,4 +2,5 @@ const isInsideNodeModules: () => boolean = $newZigFunction("node_util_binding.zi
export default {
isInsideNodeModules,
__proto__: null,
};

View File

@@ -13,6 +13,7 @@ let exports = {
clear: "",
reset: "",
hasColors: false,
__proto__: null,
shouldColorize(stream: WriteStream) {
if (process.env.FORCE_COLOR !== undefined) {
return require("internal/tty").getColorDepth(process.env) > 2;

View File

@@ -2759,6 +2759,7 @@ function internalGetConstructorName(val) {
}
export default {
__proto__: null,
inspect,
format,
formatWithOptions,

View File

@@ -86,6 +86,7 @@ function validateOneOf(value, name, oneOf) {
hideFromStack(validateOneOf);
export default {
__proto__: null,
validateObject: validateObject,
validateLinkHeaderValue: validateLinkHeaderValue,
checkIsHttpToken: checkIsHttpToken,

View File

@@ -775,6 +775,7 @@ function newStreamDuplexFromReadableWritablePair(pair = kEmptyObject, options =
}
export default {
__proto__: null,
newWritableStreamFromStreamWritable,
newReadableStreamFromStreamReadable,
newStreamWritableFromWritableStream,

View File

@@ -476,6 +476,7 @@ const asyncWrapProviders = {
};
export default {
__proto__: null,
AsyncLocalStorage,
createHook,
executionAsyncId,

View File

@@ -1881,6 +1881,7 @@ class SystemError extends Error {
}
export default {
__proto__: null,
ChildProcess,
spawn,
execFile,

View File

@@ -1080,6 +1080,7 @@ ObjectDefineProperty(UDP.prototype, 'owner', {
*/
export default {
__proto__: null,
/*
_createSocketHandle: deprecate(
_createSocketHandle,

View File

@@ -391,6 +391,7 @@ function tracingChannel(nameOrChannels) {
}
export default {
__proto__: null,
channel,
hasSubscribers,
subscribe,

View File

@@ -966,6 +966,8 @@ for (const [method, pMethod] of [
}
export default {
__proto__: null,
ADDRCONFIG: dns.ADDRCONFIG,
ALL: dns.ALL,
V4MAPPED: dns.V4MAPPED,

View File

@@ -4,7 +4,9 @@ let EventEmitter;
const ObjectDefineProperty = Object.defineProperty;
// Export Domain
var domain: any = {};
var domain: any = {
__proto__: null,
};
domain.createDomain = domain.create = function () {
if (!EventEmitter) {
EventEmitter = require("node:events");

View File

@@ -160,6 +160,7 @@ const _writeFile = fs.writeFile.bind(fs);
const _appendFile = fs.appendFile.bind(fs);
const exports = {
__proto__: null,
access: asyncWrap(fs.access, "access"),
appendFile: async function (fileHandleOrFdOrPath, ...args) {
fileHandleOrFdOrPath = fileHandleOrFdOrPath?.[kFd] ?? fileHandleOrFdOrPath;

View File

@@ -1472,6 +1472,7 @@ function _toUnixTimestamp(time: any, name = "time") {
}
export default {
__proto__: null,
Dirent,
FSWatcher,
ReadStream,

View File

@@ -2361,6 +2361,7 @@ const getMaxHTTPHeaderSize = $newZigFunction("node_http_binding.zig", "getMaxHTT
var globalAgent = new Agent();
export default {
__proto__: null,
Agent,
Server,
METHODS,

View File

@@ -52,5 +52,6 @@ var https = {
createServer: http.createServer,
get,
request,
__proto__: null,
};
export default https;

View File

@@ -36,6 +36,7 @@ const console = {
};
export default {
__proto__: null,
console,
open,
close,

View File

@@ -1541,6 +1541,7 @@ class BlockList {
}
export default {
__proto__: null,
createServer,
Server,
createConnection,

View File

@@ -110,6 +110,7 @@ Object.setPrototypeOf(PerformanceResourceTiming.prototype, PerformanceEntry.prot
Object.setPrototypeOf(PerformanceResourceTiming, PerformanceEntry);
export default {
__proto__: null,
performance: {
mark(f) {
return performance.mark(...arguments);

View File

@@ -390,6 +390,8 @@ const toASCII = function (input) {
/** Define the public API */
export default {
__proto__: null,
/**
* A string representing the current Punycode.js version number.
* @memberOf punycode

View File

@@ -2828,6 +2828,7 @@ var PromisesInterface = class Interface extends _Interface {
// Exports
// ----------------------------------------------------------------------------
export default {
__proto__: null,
Interface,
clearLine,
clearScreenDown,

View File

@@ -78,6 +78,7 @@ const builtinModules = [
];
export default {
__proto__: null,
lines: [],
context: globalThis,
historyIndex: -1,

View File

@@ -55,4 +55,5 @@ export default {
json,
buffer,
blob,
__proto__: null,
};

View File

@@ -17,4 +17,5 @@ export default {
TextDecoderStream,
CompressionStream: undefined,
DecompressionStream: undefined,
__proto__: null,
};

View File

@@ -27,6 +27,7 @@ function afterEach() {
}
export default {
__proto__: null,
suite,
test,
describe: suite,

View File

@@ -205,6 +205,7 @@ export default {
setTimeout: setTimeoutPromise,
setImmediate: setImmediatePromise,
setInterval: setIntervalPromise,
__proto__: null,
scheduler: {
wait: (delay, options) => setTimeoutPromise(delay, undefined, options),
yield: setImmediatePromise,

View File

@@ -9,6 +9,7 @@ export default {
setImmediate,
clearInterval,
clearImmediate,
__proto__: null,
get promises() {
return (timersPromisesValue ??= require("node:timers/promises"));
},

View File

@@ -749,4 +749,5 @@ export default {
TLSSocket,
checkServerIdentity,
rootCertificates,
__proto__: null,
};

View File

@@ -23,4 +23,5 @@ function getEnabledCategories() {
export default {
createTracing,
getEnabledCategories,
__proto__: null,
};

View File

@@ -160,4 +160,4 @@ Object.defineProperty(WriteStream, "prototype", {
configurable: true,
});
export default { ReadStream, WriteStream, isatty };
export default { ReadStream, WriteStream, isatty, __proto__: null };

View File

@@ -940,6 +940,7 @@ const enum Char {
}
export default {
__proto__: null,
parse: urlParse,
resolve: urlResolve,
resolveObject: urlResolveObject,

View File

@@ -371,6 +371,7 @@ cjs_exports = {
isFunction,
isPrimitive,
log,
__proto__: null,
};
export default cjs_exports;

View File

@@ -174,6 +174,7 @@ const promiseHooks = {
};
export default {
__proto__: null,
cachedDataVersionTag,
getHeapSnapshot,
getHeapStatistics,

View File

@@ -47,6 +47,7 @@ const constants = {
};
export default {
__proto__: null,
createContext,
runInContext,
runInNewContext,

View File

@@ -1934,4 +1934,4 @@ var require_wasi = __commonJS({
exports.default = WASI;
},
});
export default { WASI: require_wasi().default };
export default { WASI: require_wasi().default, __proto__: null };

View File

@@ -366,4 +366,5 @@ export default {
receiveMessageOnPort,
SHARE_ENV,
threadId,
__proto__: null,
};

View File

@@ -730,6 +730,7 @@ const zlib = {
Unzip,
BrotliCompress,
BrotliDecompress,
__proto__: null,
deflate: createConvenienceMethod(Deflate, false, "deflate"),
deflateSync: createConvenienceMethod(Deflate, true, "deflateSync"),