diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/js/node/http.js | 108 | ||||
-rw-r--r-- | src/js/out/WebCoreJSBuiltins.cpp | 136 | ||||
-rw-r--r-- | src/js/out/modules/node/http.js | 69 |
3 files changed, 111 insertions, 202 deletions
diff --git a/src/js/node/http.js b/src/js/node/http.js index 658e45433..fe9730101 100644 --- a/src/js/node/http.js +++ b/src/js/node/http.js @@ -173,20 +173,20 @@ export function createServer(options, callback) { } export class Agent extends EventEmitter { - #defaultPort = 80; - #protocol = "http:"; - #options; - #requests; - #sockets; - #freeSockets; - - #keepAliveMsecs; - #keepAlive; - #maxSockets; - #maxFreeSockets; - #scheduling; - #maxTotalSockets; - #totalSocketCount; + defaultPort = 80; + protocol = "http:"; + options; + requests; + sockets; + freeSockets; + + keepAliveMsecs; + keepAlive; + maxSockets; + maxFreeSockets; + scheduling; + maxTotalSockets; + totalSocketCount; #fakeSocket; @@ -200,75 +200,23 @@ export class Agent extends EventEmitter { constructor(options = kEmptyObject) { super(); - this.#options = options = { ...options, path: null }; + this.options = options = { ...options, path: null }; if (options.noDelay === undefined) options.noDelay = true; // Don't confuse net and make it think that we're connecting to a pipe - this.#requests = kEmptyObject; - this.#sockets = kEmptyObject; - this.#freeSockets = kEmptyObject; - - this.#keepAliveMsecs = options.keepAliveMsecs || 1000; - this.#keepAlive = options.keepAlive || false; - this.#maxSockets = options.maxSockets || Agent.defaultMaxSockets; - this.#maxFreeSockets = options.maxFreeSockets || 256; - this.#scheduling = options.scheduling || "lifo"; - this.#maxTotalSockets = options.maxTotalSockets; - this.#totalSocketCount = 0; - this.#defaultPort = options.defaultPort || 80; - this.#protocol = options.protocol || "http:"; - } - - get defaultPort() { - return this.#defaultPort; - } - - get protocol() { - return this.#protocol; - } - - get requests() { - return this.#requests; - } - - get sockets() { - return this.#sockets; - } - - get freeSockets() { - return this.#freeSockets; - } - - get options() { - return this.#options; - } - - get keepAliveMsecs() { - return this.#keepAliveMsecs; - } - - get keepAlive() { - return this.#keepAlive; - } - - get maxSockets() { - return this.#maxSockets; - } - - get maxFreeSockets() { - return this.#maxFreeSockets; - } - - get scheduling() { - return this.#scheduling; - } - - get maxTotalSockets() { - return this.#maxTotalSockets; - } - - get totalSocketCount() { - return this.#totalSocketCount; + this.requests = kEmptyObject; + this.sockets = kEmptyObject; + this.freeSockets = kEmptyObject; + + this.keepAliveMsecs = options.keepAliveMsecs || 1000; + this.keepAlive = options.keepAlive || false; + this.maxSockets = options.maxSockets || Agent.defaultMaxSockets; + this.maxFreeSockets = options.maxFreeSockets || 256; + this.scheduling = options.scheduling || "lifo"; + this.maxTotalSockets = options.maxTotalSockets; + this.totalSocketCount = 0; + this.defaultPort = options.defaultPort || 80; + this.protocol = options.protocol || "http:"; } createConnection() { diff --git a/src/js/out/WebCoreJSBuiltins.cpp b/src/js/out/WebCoreJSBuiltins.cpp index f90125c70..f5d39d398 100644 --- a/src/js/out/WebCoreJSBuiltins.cpp +++ b/src/js/out/WebCoreJSBuiltins.cpp @@ -32,7 +32,7 @@ const JSC::ConstructorKind s_bundlerPluginRunOnLoadPluginsCodeConstructorKind = const JSC::ImplementationVisibility s_bundlerPluginRunOnLoadPluginsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_bundlerPluginRunOnLoadPluginsCodeLength = 1325; static const JSC::Intrinsic s_bundlerPluginRunOnLoadPluginsCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_bundlerPluginRunOnLoadPluginsCode = "(function (b,q,v,w){\"use strict\";const x={jsx:0,js:1,ts:2,tsx:3,css:4,file:5,json:6,toml:7,wasm:8,napi:9,base64:10,dataurl:11,text:12},y=[\"jsx\",\"js\",\"ts\",\"tsx\",\"css\",\"file\",\"json\",\"toml\",\"wasm\",\"napi\",\"base64\",\"dataurl\",\"text\"][w];var g=(async(z,B,C,F)=>{var G=this.onLoad.@get(C);if(!G)return this.onLoadAsync(z,null,null),null;for(let[K,Q]of G)if(K.test(B)){var j=Q({path:B,namespace:C,loader:F});while(j&&@isPromise(j)&&(@getPromiseInternalField(j,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)j=@getPromiseInternalField(j,@promiseFieldReactionsOrResult);if(j&&@isPromise(j))j=await j;if(!j||!@isObject(j))continue;var{contents:H,loader:J=F}=j;if(typeof H!==\"string\"&&!@isTypedArrayView(H))@throwTypeError('onLoad plugins must return an object with \"contents\" as a string or Uint8Array');if(typeof J!==\"string\")@throwTypeError('onLoad plugins must return an object with \"loader\" as a string');const T=x[J];if(T===@undefined)@throwTypeError(`Loader ${J} is not supported.`);return this.onLoadAsync(z,H,T),null}return this.onLoadAsync(z,null,null),null})(b,q,v,y);while(g&&@isPromise(g)&&(@getPromiseInternalField(g,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)g=@getPromiseInternalField(g,@promiseFieldReactionsOrResult);if(g&&@isPromise(g))g.then(()=>{},(z)=>{this.addError(b,z,1)})})\n"; +const char* const s_bundlerPluginRunOnLoadPluginsCode = "(function (w,G,H,x){\"use strict\";const C={jsx:0,js:1,ts:2,tsx:3,css:4,file:5,json:6,toml:7,wasm:8,napi:9,base64:10,dataurl:11,text:12},b=[\"jsx\",\"js\",\"ts\",\"tsx\",\"css\",\"file\",\"json\",\"toml\",\"wasm\",\"napi\",\"base64\",\"dataurl\",\"text\"][x];var J=(async(K,z,Q,F)=>{var g=this.onLoad.@get(Q);if(!g)return this.onLoadAsync(K,null,null),null;for(let[B,v]of g)if(B.test(z)){var q=v({path:z,namespace:Q,loader:F});while(q&&@isPromise(q)&&(@getPromiseInternalField(q,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)q=@getPromiseInternalField(q,@promiseFieldReactionsOrResult);if(q&&@isPromise(q))q=await q;if(!q||!@isObject(q))continue;var{contents:T,loader:y=F}=q;if(typeof T!==\"string\"&&!@isTypedArrayView(T))@throwTypeError('onLoad plugins must return an object with \"contents\" as a string or Uint8Array');if(typeof y!==\"string\")@throwTypeError('onLoad plugins must return an object with \"loader\" as a string');const j=C[y];if(j===@undefined)@throwTypeError(`Loader ${y} is not supported.`);return this.onLoadAsync(K,T,j),null}return this.onLoadAsync(K,null,null),null})(w,G,H,b);while(J&&@isPromise(J)&&(@getPromiseInternalField(J,@promiseFieldFlags)&@promiseStateMask)===@promiseStateFulfilled)J=@getPromiseInternalField(J,@promiseFieldReactionsOrResult);if(J&&@isPromise(J))J.then(()=>{},(K)=>{this.addError(w,K,1)})})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ @@ -116,7 +116,7 @@ const JSC::ConstructorKind s_writableStreamInternalsCreateInternalWritableStream const JSC::ImplementationVisibility s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeLength = 956; static const JSC::Intrinsic s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode = "(function (f,o){\"use strict\";const w={};if(f===@undefined)f={};if(o===@undefined)o={};if(!@isObject(f))@throwTypeError(\"WritableStream constructor takes an object as first argument\");if(\"type\"in f)@throwRangeError(\"Invalid type is specified\");const C=@extractSizeAlgorithm(o),E=@extractHighWaterMark(o,1),_={};if(\"start\"in f){if(_[\"start\"]=f[\"start\"],typeof _[\"start\"]!==\"function\")@throwTypeError(\"underlyingSink.start should be a function\")}if(\"write\"in f){if(_[\"write\"]=f[\"write\"],typeof _[\"write\"]!==\"function\")@throwTypeError(\"underlyingSink.write should be a function\")}if(\"close\"in f){if(_[\"close\"]=f[\"close\"],typeof _[\"close\"]!==\"function\")@throwTypeError(\"underlyingSink.close should be a function\")}if(\"abort\"in f){if(_[\"abort\"]=f[\"abort\"],typeof _[\"abort\"]!==\"function\")@throwTypeError(\"underlyingSink.abort should be a function\")}return @initializeWritableStreamSlots(w,f),@setUpWritableStreamDefaultControllerFromUnderlyingSink(w,f,_,E,C),w})\n"; +const char* const s_writableStreamInternalsCreateInternalWritableStreamFromUnderlyingSinkCode = "(function (o,w){\"use strict\";const C={};if(o===@undefined)o={};if(w===@undefined)w={};if(!@isObject(o))@throwTypeError(\"WritableStream constructor takes an object as first argument\");if(\"type\"in o)@throwRangeError(\"Invalid type is specified\");const E=@extractSizeAlgorithm(w),_=@extractHighWaterMark(w,1),f={};if(\"start\"in o){if(f[\"start\"]=o[\"start\"],typeof f[\"start\"]!==\"function\")@throwTypeError(\"underlyingSink.start should be a function\")}if(\"write\"in o){if(f[\"write\"]=o[\"write\"],typeof f[\"write\"]!==\"function\")@throwTypeError(\"underlyingSink.write should be a function\")}if(\"close\"in o){if(f[\"close\"]=o[\"close\"],typeof f[\"close\"]!==\"function\")@throwTypeError(\"underlyingSink.close should be a function\")}if(\"abort\"in o){if(f[\"abort\"]=o[\"abort\"],typeof f[\"abort\"]!==\"function\")@throwTypeError(\"underlyingSink.abort should be a function\")}return @initializeWritableStreamSlots(C,o),@setUpWritableStreamDefaultControllerFromUnderlyingSink(C,o,f,_,E),C})\n"; // initializeWritableStreamSlots const JSC::ConstructAbility s_writableStreamInternalsInitializeWritableStreamSlotsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -180,7 +180,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamAddWriteReques const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamAddWriteRequestCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_writableStreamInternalsWritableStreamAddWriteRequestCodeLength = 227; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamAddWriteRequestCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamAddWriteRequestCode = "(function (d){\"use strict\";@assert(@isWritableStreamLocked(d)),@assert(@getByIdDirectPrivate(d,\"state\")===\"writable\");const h=@newPromiseCapability(@Promise);return @getByIdDirectPrivate(d,\"writeRequests\").push(h),h.@promise})\n"; +const char* const s_writableStreamInternalsWritableStreamAddWriteRequestCode = "(function (c){\"use strict\";@assert(@isWritableStreamLocked(c)),@assert(@getByIdDirectPrivate(c,\"state\")===\"writable\");const d=@newPromiseCapability(@Promise);return @getByIdDirectPrivate(c,\"writeRequests\").push(d),d.@promise})\n"; // writableStreamCloseQueuedOrInFlight const JSC::ConstructAbility s_writableStreamInternalsWritableStreamCloseQueuedOrInFlightCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -204,7 +204,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamFinishErroring const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamFinishErroringCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_writableStreamInternalsWritableStreamFinishErroringCodeLength = 1058; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamFinishErroringCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamFinishErroringCode = "(function (i){\"use strict\";@assert(@getByIdDirectPrivate(i,\"state\")===\"erroring\"),@assert(!@writableStreamHasOperationMarkedInFlight(i)),@putByIdDirectPrivate(i,\"state\",\"errored\");const p=@getByIdDirectPrivate(i,\"controller\");@getByIdDirectPrivate(p,\"errorSteps\").@call();const h=@getByIdDirectPrivate(i,\"storedError\"),A=@getByIdDirectPrivate(i,\"writeRequests\");for(var B=A.shift();B;B=A.shift())B.@reject.@call(@undefined,h);@putByIdDirectPrivate(i,\"writeRequests\",@createFIFO());const I=@getByIdDirectPrivate(i,\"pendingAbortRequest\");if(I===@undefined){@writableStreamRejectCloseAndClosedPromiseIfNeeded(i);return}if(@putByIdDirectPrivate(i,\"pendingAbortRequest\",@undefined),I.wasAlreadyErroring){I.promise.@reject.@call(@undefined,h),@writableStreamRejectCloseAndClosedPromiseIfNeeded(i);return}@getByIdDirectPrivate(p,\"abortSteps\").@call(@undefined,I.reason).@then(()=>{I.promise.@resolve.@call(),@writableStreamRejectCloseAndClosedPromiseIfNeeded(i)},(_)=>{I.promise.@reject.@call(@undefined,_),@writableStreamRejectCloseAndClosedPromiseIfNeeded(i)})})\n"; +const char* const s_writableStreamInternalsWritableStreamFinishErroringCode = "(function (_){\"use strict\";@assert(@getByIdDirectPrivate(_,\"state\")===\"erroring\"),@assert(!@writableStreamHasOperationMarkedInFlight(_)),@putByIdDirectPrivate(_,\"state\",\"errored\");const p=@getByIdDirectPrivate(_,\"controller\");@getByIdDirectPrivate(p,\"errorSteps\").@call();const h=@getByIdDirectPrivate(_,\"storedError\"),A=@getByIdDirectPrivate(_,\"writeRequests\");for(var I=A.shift();I;I=A.shift())I.@reject.@call(@undefined,h);@putByIdDirectPrivate(_,\"writeRequests\",@createFIFO());const i=@getByIdDirectPrivate(_,\"pendingAbortRequest\");if(i===@undefined){@writableStreamRejectCloseAndClosedPromiseIfNeeded(_);return}if(@putByIdDirectPrivate(_,\"pendingAbortRequest\",@undefined),i.wasAlreadyErroring){i.promise.@reject.@call(@undefined,h),@writableStreamRejectCloseAndClosedPromiseIfNeeded(_);return}@getByIdDirectPrivate(p,\"abortSteps\").@call(@undefined,i.reason).@then(()=>{i.promise.@resolve.@call(),@writableStreamRejectCloseAndClosedPromiseIfNeeded(_)},(B)=>{i.promise.@reject.@call(@undefined,B),@writableStreamRejectCloseAndClosedPromiseIfNeeded(_)})})\n"; // writableStreamFinishInFlightClose const JSC::ConstructAbility s_writableStreamInternalsWritableStreamFinishInFlightCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -268,7 +268,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamRejectCloseAnd const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeLength = 516; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode = "(function (i){\"use strict\";@assert(@getByIdDirectPrivate(i,\"state\")===\"errored\");const n=@getByIdDirectPrivate(i,\"storedError\"),h=@getByIdDirectPrivate(i,\"closeRequest\");if(h!==@undefined)@assert(@getByIdDirectPrivate(i,\"inFlightCloseRequest\")===@undefined),h.@reject.@call(@undefined,n),@putByIdDirectPrivate(i,\"closeRequest\",@undefined);const B=@getByIdDirectPrivate(i,\"writer\");if(B!==@undefined){const b=@getByIdDirectPrivate(B,\"closedPromise\");b.@reject.@call(@undefined,n),@markPromiseAsHandled(b.@promise)}})\n"; +const char* const s_writableStreamInternalsWritableStreamRejectCloseAndClosedPromiseIfNeededCode = "(function (i){\"use strict\";@assert(@getByIdDirectPrivate(i,\"state\")===\"errored\");const h=@getByIdDirectPrivate(i,\"storedError\"),n=@getByIdDirectPrivate(i,\"closeRequest\");if(n!==@undefined)@assert(@getByIdDirectPrivate(i,\"inFlightCloseRequest\")===@undefined),n.@reject.@call(@undefined,h),@putByIdDirectPrivate(i,\"closeRequest\",@undefined);const B=@getByIdDirectPrivate(i,\"writer\");if(B!==@undefined){const b=@getByIdDirectPrivate(B,\"closedPromise\");b.@reject.@call(@undefined,h),@markPromiseAsHandled(b.@promise)}})\n"; // writableStreamStartErroring const JSC::ConstructAbility s_writableStreamInternalsWritableStreamStartErroringCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -428,7 +428,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControl const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeLength = 89; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCode = "(function (e){\"use strict\";return @writableStreamDefaultControllerGetDesiredSize(e)<=0})\n"; +const char* const s_writableStreamInternalsWritableStreamDefaultControllerGetBackpressureCode = "(function (d){\"use strict\";return @writableStreamDefaultControllerGetDesiredSize(d)<=0})\n"; // writableStreamDefaultControllerGetChunkSize const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerGetChunkSizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -460,7 +460,7 @@ const JSC::ConstructorKind s_writableStreamInternalsWritableStreamDefaultControl const JSC::ImplementationVisibility s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeLength = 734; static const JSC::Intrinsic s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode = "(function (i,d){\"use strict\";const q=@getByIdDirectPrivate(i,\"stream\");@writableStreamMarkFirstWriteRequestInFlight(q),@getByIdDirectPrivate(i,\"writeAlgorithm\").@call(@undefined,d).@then(()=>{@writableStreamFinishInFlightWrite(q);const v=@getByIdDirectPrivate(q,\"state\");if(@assert(v===\"writable\"||v===\"erroring\"),@dequeueValue(@getByIdDirectPrivate(i,\"queue\")),!@writableStreamCloseQueuedOrInFlight(q)&&v===\"writable\"){const M=@writableStreamDefaultControllerGetBackpressure(i);@writableStreamUpdateBackpressure(q,M)}@writableStreamDefaultControllerAdvanceQueueIfNeeded(i)},(v)=>{if(@getByIdDirectPrivate(q,\"state\")===\"writable\")@writableStreamDefaultControllerClearAlgorithms(i);@writableStreamFinishInFlightWriteWithError(q,v)})})\n"; +const char* const s_writableStreamInternalsWritableStreamDefaultControllerProcessWriteCode = "(function (d,_){\"use strict\";const q=@getByIdDirectPrivate(d,\"stream\");@writableStreamMarkFirstWriteRequestInFlight(q),@getByIdDirectPrivate(d,\"writeAlgorithm\").@call(@undefined,_).@then(()=>{@writableStreamFinishInFlightWrite(q);const M=@getByIdDirectPrivate(q,\"state\");if(@assert(M===\"writable\"||M===\"erroring\"),@dequeueValue(@getByIdDirectPrivate(d,\"queue\")),!@writableStreamCloseQueuedOrInFlight(q)&&M===\"writable\"){const i=@writableStreamDefaultControllerGetBackpressure(d);@writableStreamUpdateBackpressure(q,i)}@writableStreamDefaultControllerAdvanceQueueIfNeeded(d)},(M)=>{if(@getByIdDirectPrivate(q,\"state\")===\"writable\")@writableStreamDefaultControllerClearAlgorithms(d);@writableStreamFinishInFlightWriteWithError(q,M)})})\n"; // writableStreamDefaultControllerWrite const JSC::ConstructAbility s_writableStreamInternalsWritableStreamDefaultControllerWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -550,7 +550,7 @@ const JSC::ConstructorKind s_transformStreamInternalsSetUpTransformStreamDefault const JSC::ImplementationVisibility s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeLength = 449; static const JSC::Intrinsic s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode = "(function (_,p,v){\"use strict\";const b=new @TransformStreamDefaultController;let q=(d)=>{try{@transformStreamDefaultControllerEnqueue(b,d)}catch(j){return @Promise.@reject(j)}return @Promise.@resolve()},w=()=>{return @Promise.@resolve()};if(\"transform\"in v)q=(d)=>{return @promiseInvokeOrNoopMethod(p,v[\"transform\"],[d,b])};if(\"flush\"in v)w=()=>{return @promiseInvokeOrNoopMethod(p,v[\"flush\"],[b])};@setUpTransformStreamDefaultController(_,b,q,w)})\n"; +const char* const s_transformStreamInternalsSetUpTransformStreamDefaultControllerFromTransformerCode = "(function (d,p,v){\"use strict\";const b=new @TransformStreamDefaultController;let q=(j)=>{try{@transformStreamDefaultControllerEnqueue(b,j)}catch(w){return @Promise.@reject(w)}return @Promise.@resolve()},_=()=>{return @Promise.@resolve()};if(\"transform\"in v)q=(j)=>{return @promiseInvokeOrNoopMethod(p,v[\"transform\"],[j,b])};if(\"flush\"in v)_=()=>{return @promiseInvokeOrNoopMethod(p,v[\"flush\"],[b])};@setUpTransformStreamDefaultController(d,b,q,_)})\n"; // transformStreamDefaultControllerClearAlgorithms const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultControllerClearAlgorithmsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -598,7 +598,7 @@ const JSC::ConstructorKind s_transformStreamInternalsTransformStreamDefaultSinkW const JSC::ImplementationVisibility s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeLength = 764; static const JSC::Intrinsic s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode = "(function (_,d){\"use strict\";const v=@getByIdDirectPrivate(_,\"internalWritable\");@assert(@getByIdDirectPrivate(v,\"state\")===\"writable\");const f=@getByIdDirectPrivate(_,\"controller\");if(@getByIdDirectPrivate(_,\"backpressure\")){const j=@newPromiseCapability(@Promise),q=@getByIdDirectPrivate(_,\"backpressureChangePromise\");return @assert(q!==@undefined),q.@promise.@then(()=>{const x=@getByIdDirectPrivate(v,\"state\");if(x===\"erroring\"){j.@reject.@call(@undefined,@getByIdDirectPrivate(v,\"storedError\"));return}@assert(x===\"writable\"),@transformStreamDefaultControllerPerformTransform(f,d).@then(()=>{j.@resolve()},(z)=>{j.@reject.@call(@undefined,z)})},(x)=>{j.@reject.@call(@undefined,x)}),j.@promise}return @transformStreamDefaultControllerPerformTransform(f,d)})\n"; +const char* const s_transformStreamInternalsTransformStreamDefaultSinkWriteAlgorithmCode = "(function (d,v){\"use strict\";const f=@getByIdDirectPrivate(d,\"internalWritable\");@assert(@getByIdDirectPrivate(f,\"state\")===\"writable\");const j=@getByIdDirectPrivate(d,\"controller\");if(@getByIdDirectPrivate(d,\"backpressure\")){const x=@newPromiseCapability(@Promise),_=@getByIdDirectPrivate(d,\"backpressureChangePromise\");return @assert(_!==@undefined),_.@promise.@then(()=>{const q=@getByIdDirectPrivate(f,\"state\");if(q===\"erroring\"){x.@reject.@call(@undefined,@getByIdDirectPrivate(f,\"storedError\"));return}@assert(q===\"writable\"),@transformStreamDefaultControllerPerformTransform(j,v).@then(()=>{x.@resolve()},(z)=>{x.@reject.@call(@undefined,z)})},(q)=>{x.@reject.@call(@undefined,q)}),x.@promise}return @transformStreamDefaultControllerPerformTransform(j,v)})\n"; // transformStreamDefaultSinkAbortAlgorithm const JSC::ConstructAbility s_transformStreamInternalsTransformStreamDefaultSinkAbortAlgorithmCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -648,7 +648,7 @@ const JSC::ConstructorKind s_processObjectInternalsGetStdioWriteStreamCodeConstr const JSC::ImplementationVisibility s_processObjectInternalsGetStdioWriteStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_processObjectInternalsGetStdioWriteStreamCodeLength = 4250; static const JSC::Intrinsic s_processObjectInternalsGetStdioWriteStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_processObjectInternalsGetStdioWriteStreamCode = "(function (A,M){\"use strict\";var Q={path:\"node:process\",require:M},N=(Z)=>Q.require(Z);function O(Z){var{Duplex:T,eos:x,destroy:Y}=N(\"node:stream\"),G=class j extends T{#$;#B;#j=!0;#z=!0;#G;#H;#J;#K;#L;#M;get isTTY(){return this.#M\?\?=N(\"node:tty\").isatty(Z)}get fd(){return Z}constructor(V){super({readable:!0,writable:!0});this.#G=`/dev/fd/${V}`}#N(V){const L=this.#H;if(this.#H=null,L)L(V);else if(V)this.destroy(V);else if(!this.#j&&!this.#z)this.destroy()}_destroy(V,L){if(!V&&this.#H!==null){var X=class J extends Error{code;name;constructor(H=\"The operation was aborted\",P=void 0){if(P!==void 0&&typeof P!==\"object\")throw new Error(`Invalid AbortError options:\\n\\n${JSON.stringify(P,null,2)}`);super(H,P);this.code=\"ABORT_ERR\",this.name=\"AbortError\"}};V=new X}if(this.#J=null,this.#K=null,this.#H===null)L(V);else{if(this.#H=L,this.#$)Y(this.#$,V);if(this.#B)Y(this.#B,V)}}_write(V,L,X){if(!this.#$){var{createWriteStream:J}=N(\"node:fs\"),H=this.#$=J(this.#G);H.on(\"finish\",()=>{if(this.#K){const P=this.#K;this.#K=null,P()}}),H.on(\"drain\",()=>{if(this.#J){const P=this.#J;this.#J=null,P()}}),x(H,(P)=>{if(this.#z=!1,P)Y(H,P);this.#N(P)})}if(H.write(V,L))X();else this.#J=X}_final(V){this.#$&&this.#$.end(),this.#K=V}#O(){var{createReadStream:V}=N(\"node:fs\"),L=this.#B=V(this.#G);return L.on(\"readable\",()=>{if(this.#L){const X=this.#L;this.#L=null,X()}else this.read()}),L.on(\"end\",()=>{this.push(null)}),x(L,(X)=>{if(this.#j=!1,X)Y(L,X);this.#N(X)}),L}_read(){var V=this.#B;if(!V)V=this.#O();while(!0){const L=V.read();if(L===null||!this.push(L))return}}};return new G(Z)}var{EventEmitter:z}=N(\"node:events\");function B(Z){if(!Z)return!0;var T=Z.toLowerCase();return T===\"utf8\"||T===\"utf-8\"||T===\"buffer\"||T===\"binary\"}var U,K=class Z extends z{#$;#B;#j;#z;bytesWritten=0;setDefaultEncoding(T){if(this.#B||!B(T))return this.#J(),this.#B.setDefaultEncoding(T)}#G(){switch(this.#$){case 1:{var T=@Bun.stdout.writer({highWaterMark:0});return T.unref(),T}case 2:{var T=@Bun.stderr.writer({highWaterMark:0});return T.unref(),T}default:throw new Error(\"Unsupported writer\")}}#H(){return this.#j\?\?=this.#G()}constructor(T){super();this.#$=T}get fd(){return this.#$}get isTTY(){return this.#z\?\?=N(\"node:tty\").isatty(this.#$)}cursorTo(T,x,Y){return(U\?\?=N(\"readline\")).cursorTo(this,T,x,Y)}moveCursor(T,x,Y){return(U\?\?=N(\"readline\")).moveCursor(this,T,x,Y)}clearLine(T,x){return(U\?\?=N(\"readline\")).clearLine(this,T,x)}clearScreenDown(T){return(U\?\?=N(\"readline\")).clearScreenDown(this,T)}ref(){this.#H().ref()}unref(){this.#H().unref()}on(T,x){if(T===\"close\"||T===\"finish\")return this.#J(),this.#B.on(T,x);if(T===\"drain\")return super.on(\"drain\",x);if(T===\"error\")return super.on(\"error\",x);return super.on(T,x)}get _writableState(){return this.#J(),this.#B._writableState}get _readableState(){return this.#J(),this.#B._readableState}pipe(T){return this.#J(),this.#B.pipe(T)}unpipe(T){return this.#J(),this.#B.unpipe(T)}#J(){if(this.#B)return;this.#B=O(this.#$);const T=this.eventNames();for(let x of T)this.#B.on(x,(...Y)=>{this.emit(x,...Y)})}#K(T){var x=this.#H();const Y=x.write(T);this.bytesWritten+=Y;const G=x.flush(!1);return!!(Y||G)}#L(T,x){if(!B(x))return this.#J(),this.#B.write(T,x);return this.#K(T)}#M(T,x){if(x)this.emit(\"error\",x);try{T(x\?x:null)}catch(Y){this.emit(\"error\",Y)}}#N(T,x,Y){if(!B(x))return this.#J(),this.#B.write(T,x,Y);var G=this.#H();const j=G.write(T),V=G.flush(!0);if(V\?.then)return V.then(()=>{this.#M(Y),this.emit(\"drain\")},(L)=>this.#M(Y,L)),!1;return queueMicrotask(()=>{this.#M(Y)}),!!(j||V)}write(T,x,Y){const G=this._write(T,x,Y);if(G)this.emit(\"drain\");return G}get hasColors(){return @Bun.tty[this.#$].hasColors}_write(T,x,Y){var G=this.#B;if(G)return G.write(T,x,Y);switch(arguments.length){case 0:{var j=new Error(\"Invalid arguments\");throw j.code=\"ERR_INVALID_ARG_TYPE\",j}case 1:return this.#K(T);case 2:if(typeof x===\"function\")return this.#N(T,\"\",x);else if(typeof x===\"string\")return this.#L(T,x);default:{if(typeof x!==\"undefined\"&&typeof x!==\"string\"||typeof Y!==\"undefined\"&&typeof Y!==\"function\"){var j=new Error(\"Invalid arguments\");throw j.code=\"ERR_INVALID_ARG_TYPE\",j}if(typeof Y===\"undefined\")return this.#L(T,x);return this.#N(T,x,Y)}}}destroy(){return this}end(){return this}};return new K(A)})\n"; +const char* const s_processObjectInternalsGetStdioWriteStreamCode = "(function (j,z){\"use strict\";var L={path:\"node:process\",require:z},K=(N)=>L.require(N);function G(N){var{Duplex:O,eos:Q,destroy:U}=K(\"node:stream\"),V=class X extends O{#$;#B;#j=!0;#z=!0;#G;#H;#J;#K;#L;#M;get isTTY(){return this.#M\?\?=K(\"node:tty\").isatty(N)}get fd(){return N}constructor(Z){super({readable:!0,writable:!0});this.#G=`/dev/fd/${Z}`}#N(Z){const Y=this.#H;if(this.#H=null,Y)Y(Z);else if(Z)this.destroy(Z);else if(!this.#j&&!this.#z)this.destroy()}_destroy(Z,Y){if(!Z&&this.#H!==null){var P=class A extends Error{code;name;constructor(T=\"The operation was aborted\",x=void 0){if(x!==void 0&&typeof x!==\"object\")throw new Error(`Invalid AbortError options:\\n\\n${JSON.stringify(x,null,2)}`);super(T,x);this.code=\"ABORT_ERR\",this.name=\"AbortError\"}};Z=new P}if(this.#J=null,this.#K=null,this.#H===null)Y(Z);else{if(this.#H=Y,this.#$)U(this.#$,Z);if(this.#B)U(this.#B,Z)}}_write(Z,Y,P){if(!this.#$){var{createWriteStream:A}=K(\"node:fs\"),T=this.#$=A(this.#G);T.on(\"finish\",()=>{if(this.#K){const x=this.#K;this.#K=null,x()}}),T.on(\"drain\",()=>{if(this.#J){const x=this.#J;this.#J=null,x()}}),Q(T,(x)=>{if(this.#z=!1,x)U(T,x);this.#N(x)})}if(T.write(Z,Y))P();else this.#J=P}_final(Z){this.#$&&this.#$.end(),this.#K=Z}#O(){var{createReadStream:Z}=K(\"node:fs\"),Y=this.#B=Z(this.#G);return Y.on(\"readable\",()=>{if(this.#L){const P=this.#L;this.#L=null,P()}else this.read()}),Y.on(\"end\",()=>{this.push(null)}),Q(Y,(P)=>{if(this.#j=!1,P)U(Y,P);this.#N(P)}),Y}_read(){var Z=this.#B;if(!Z)Z=this.#O();while(!0){const Y=Z.read();if(Y===null||!this.push(Y))return}}};return new V(N)}var{EventEmitter:H}=K(\"node:events\");function M(N){if(!N)return!0;var O=N.toLowerCase();return O===\"utf8\"||O===\"utf-8\"||O===\"buffer\"||O===\"binary\"}var J,B=class N extends H{#$;#B;#j;#z;bytesWritten=0;setDefaultEncoding(O){if(this.#B||!M(O))return this.#J(),this.#B.setDefaultEncoding(O)}#G(){switch(this.#$){case 1:{var O=@Bun.stdout.writer({highWaterMark:0});return O.unref(),O}case 2:{var O=@Bun.stderr.writer({highWaterMark:0});return O.unref(),O}default:throw new Error(\"Unsupported writer\")}}#H(){return this.#j\?\?=this.#G()}constructor(O){super();this.#$=O}get fd(){return this.#$}get isTTY(){return this.#z\?\?=K(\"node:tty\").isatty(this.#$)}cursorTo(O,Q,U){return(J\?\?=K(\"readline\")).cursorTo(this,O,Q,U)}moveCursor(O,Q,U){return(J\?\?=K(\"readline\")).moveCursor(this,O,Q,U)}clearLine(O,Q){return(J\?\?=K(\"readline\")).clearLine(this,O,Q)}clearScreenDown(O){return(J\?\?=K(\"readline\")).clearScreenDown(this,O)}ref(){this.#H().ref()}unref(){this.#H().unref()}on(O,Q){if(O===\"close\"||O===\"finish\")return this.#J(),this.#B.on(O,Q);if(O===\"drain\")return super.on(\"drain\",Q);if(O===\"error\")return super.on(\"error\",Q);return super.on(O,Q)}get _writableState(){return this.#J(),this.#B._writableState}get _readableState(){return this.#J(),this.#B._readableState}pipe(O){return this.#J(),this.#B.pipe(O)}unpipe(O){return this.#J(),this.#B.unpipe(O)}#J(){if(this.#B)return;this.#B=G(this.#$);const O=this.eventNames();for(let Q of O)this.#B.on(Q,(...U)=>{this.emit(Q,...U)})}#K(O){var Q=this.#H();const U=Q.write(O);this.bytesWritten+=U;const V=Q.flush(!1);return!!(U||V)}#L(O,Q){if(!M(Q))return this.#J(),this.#B.write(O,Q);return this.#K(O)}#M(O,Q){if(Q)this.emit(\"error\",Q);try{O(Q\?Q:null)}catch(U){this.emit(\"error\",U)}}#N(O,Q,U){if(!M(Q))return this.#J(),this.#B.write(O,Q,U);var V=this.#H();const X=V.write(O),Z=V.flush(!0);if(Z\?.then)return Z.then(()=>{this.#M(U),this.emit(\"drain\")},(Y)=>this.#M(U,Y)),!1;return queueMicrotask(()=>{this.#M(U)}),!!(X||Z)}write(O,Q,U){const V=this._write(O,Q,U);if(V)this.emit(\"drain\");return V}get hasColors(){return @Bun.tty[this.#$].hasColors}_write(O,Q,U){var V=this.#B;if(V)return V.write(O,Q,U);switch(arguments.length){case 0:{var X=new Error(\"Invalid arguments\");throw X.code=\"ERR_INVALID_ARG_TYPE\",X}case 1:return this.#K(O);case 2:if(typeof Q===\"function\")return this.#N(O,\"\",Q);else if(typeof Q===\"string\")return this.#L(O,Q);default:{if(typeof Q!==\"undefined\"&&typeof Q!==\"string\"||typeof U!==\"undefined\"&&typeof U!==\"function\"){var X=new Error(\"Invalid arguments\");throw X.code=\"ERR_INVALID_ARG_TYPE\",X}if(typeof U===\"undefined\")return this.#L(O,Q);return this.#N(O,Q,U)}}}destroy(){return this}end(){return this}};return new B(j)})\n"; // getStdinStream const JSC::ConstructAbility s_processObjectInternalsGetStdinStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -656,7 +656,7 @@ const JSC::ConstructorKind s_processObjectInternalsGetStdinStreamCodeConstructor const JSC::ImplementationVisibility s_processObjectInternalsGetStdinStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_processObjectInternalsGetStdinStreamCodeLength = 1799; static const JSC::Intrinsic s_processObjectInternalsGetStdinStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_processObjectInternalsGetStdinStreamCode = "(function (Y,j,z){\"use strict\";var G={path:\"node:process\",require:j},H=(M)=>G.require(M),{Duplex:I,eos:J,destroy:K}=H(\"node:stream\"),L=class M extends I{#Y;#$;#j;#z=!0;#G=!1;#H=!0;#I;#J;#K;get isTTY(){return H(\"tty\").isatty(Y)}get fd(){return Y}constructor(){super({readable:!0,writable:!0})}#L(N){const P=this.#J;if(this.#J=null,P)P(N);else if(N)this.destroy(N);else if(!this.#z&&!this.#H)this.destroy()}_destroy(N,P){if(!N&&this.#J!==null){var Q=class T extends Error{constructor(U=\"The operation was aborted\",V=void 0){if(V!==void 0&&typeof V!==\"object\")throw new Error(`Invalid AbortError options:\\n\\n${JSON.stringify(V,null,2)}`);super(U,V);this.code=\"ABORT_ERR\",this.name=\"AbortError\"}};N=new Q}if(this.#J===null)P(N);else if(this.#J=P,this.#j)K(this.#j,N)}setRawMode(N){}on(N,P){if(N===\"readable\")this.ref(),this.#G=!0;return super.on(N,P)}pause(){return this.unref(),super.pause()}resume(){return this.ref(),super.resume()}ref(){this.#Y\?\?=z.stdin.stream().getReader(),this.#$\?\?=setInterval(()=>{},1<<30)}unref(){if(this.#$)clearInterval(this.#$),this.#$=null}async#M(){try{var N,P;const Q=this.#Y.readMany();if(!Q\?.then)({done:N,value:P}=Q);else({done:N,value:P}=await Q);if(!N){this.push(P[0]);const T=P.length;for(let U=1;U<T;U++)this.push(P[U])}else this.push(null),this.pause(),this.#z=!1,this.#L()}catch(Q){this.#z=!1,this.#L(Q)}}_read(N){if(this.#G)this.unref(),this.#G=!1;this.#M()}#N(){var{createWriteStream:N}=H(\"node:fs\"),P=this.#j=N(\"/dev/fd/0\");return P.on(\"finish\",()=>{if(this.#I){const Q=this.#I;this.#I=null,Q()}}),P.on(\"drain\",()=>{if(this.#K){const Q=this.#K;this.#K=null,Q()}}),J(P,(Q)=>{if(this.#H=!1,Q)K(P,Q);this.#L(Q)}),P}_write(N,P,Q){var T=this.#j;if(!T)T=this.#N();if(T.write(N,P))Q();else this.#K=Q}_final(N){this.#j.end(),this.#I=(...P)=>N(...P)}};return new L})\n"; +const char* const s_processObjectInternalsGetStdinStreamCode = "(function (z,G,H){\"use strict\";var K={path:\"node:process\",require:G},L=(T)=>K.require(T),{Duplex:M,eos:N,destroy:P}=L(\"node:stream\"),Q=class T extends M{#Y;#$;#j;#z=!0;#G=!1;#H=!0;#I;#J;#K;get isTTY(){return L(\"tty\").isatty(z)}get fd(){return z}constructor(){super({readable:!0,writable:!0})}#L(Y){const j=this.#J;if(this.#J=null,j)j(Y);else if(Y)this.destroy(Y);else if(!this.#z&&!this.#H)this.destroy()}_destroy(Y,j){if(!Y&&this.#J!==null){var I=class J extends Error{constructor(U=\"The operation was aborted\",V=void 0){if(V!==void 0&&typeof V!==\"object\")throw new Error(`Invalid AbortError options:\\n\\n${JSON.stringify(V,null,2)}`);super(U,V);this.code=\"ABORT_ERR\",this.name=\"AbortError\"}};Y=new I}if(this.#J===null)j(Y);else if(this.#J=j,this.#j)P(this.#j,Y)}setRawMode(Y){}on(Y,j){if(Y===\"readable\")this.ref(),this.#G=!0;return super.on(Y,j)}pause(){return this.unref(),super.pause()}resume(){return this.ref(),super.resume()}ref(){this.#Y\?\?=H.stdin.stream().getReader(),this.#$\?\?=setInterval(()=>{},1<<30)}unref(){if(this.#$)clearInterval(this.#$),this.#$=null}async#M(){try{var Y,j;const I=this.#Y.readMany();if(!I\?.then)({done:Y,value:j}=I);else({done:Y,value:j}=await I);if(!Y){this.push(j[0]);const J=j.length;for(let U=1;U<J;U++)this.push(j[U])}else this.push(null),this.pause(),this.#z=!1,this.#L()}catch(I){this.#z=!1,this.#L(I)}}_read(Y){if(this.#G)this.unref(),this.#G=!1;this.#M()}#N(){var{createWriteStream:Y}=L(\"node:fs\"),j=this.#j=Y(\"/dev/fd/0\");return j.on(\"finish\",()=>{if(this.#I){const I=this.#I;this.#I=null,I()}}),j.on(\"drain\",()=>{if(this.#K){const I=this.#K;this.#K=null,I()}}),N(j,(I)=>{if(this.#H=!1,I)P(j,I);this.#L(I)}),j}_write(Y,j,I){var J=this.#j;if(!J)J=this.#N();if(J.write(Y,j))I();else this.#K=I}_final(Y){this.#j.end(),this.#I=(...j)=>Y(...j)}};return new Q})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ @@ -674,7 +674,7 @@ const JSC::ConstructorKind s_transformStreamInitializeTransformStreamCodeConstru const JSC::ImplementationVisibility s_transformStreamInitializeTransformStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_transformStreamInitializeTransformStreamCodeLength = 1334; static const JSC::Intrinsic s_transformStreamInitializeTransformStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamInitializeTransformStreamCode = "(function (){\"use strict\";let j=arguments[0];if(@isObject(j)&&@getByIdDirectPrivate(j,\"TransformStream\"))return this;let q=arguments[1],v=arguments[2];if(j===@undefined)j=null;if(v===@undefined)v={};if(q===@undefined)q={};let x={};if(j!==null){if(\"start\"in j){if(x[\"start\"]=j[\"start\"],typeof x[\"start\"]!==\"function\")@throwTypeError(\"transformer.start should be a function\")}if(\"transform\"in j){if(x[\"transform\"]=j[\"transform\"],typeof x[\"transform\"]!==\"function\")@throwTypeError(\"transformer.transform should be a function\")}if(\"flush\"in j){if(x[\"flush\"]=j[\"flush\"],typeof x[\"flush\"]!==\"function\")@throwTypeError(\"transformer.flush should be a function\")}if(\"readableType\"in j)@throwRangeError(\"TransformStream transformer has a readableType\");if(\"writableType\"in j)@throwRangeError(\"TransformStream transformer has a writableType\")}const B=@extractHighWaterMark(v,0),E=@extractSizeAlgorithm(v),F=@extractHighWaterMark(q,1),G=@extractSizeAlgorithm(q),I=@newPromiseCapability(@Promise);if(@initializeTransformStream(this,I.@promise,F,G,B,E),@setUpTransformStreamDefaultControllerFromTransformer(this,j,x),(\"start\"in x)){const J=@getByIdDirectPrivate(this,\"controller\");(()=>@promiseInvokeOrNoopMethodNoCatch(j,x[\"start\"],[J]))().@then(()=>{I.@resolve.@call()},(u)=>{I.@reject.@call(@undefined,u)})}else I.@resolve.@call();return this})\n"; +const char* const s_transformStreamInitializeTransformStreamCode = "(function (){\"use strict\";let _=arguments[0];if(@isObject(_)&&@getByIdDirectPrivate(_,\"TransformStream\"))return this;let B=arguments[1],u=arguments[2];if(_===@undefined)_=null;if(u===@undefined)u={};if(B===@undefined)B={};let E={};if(_!==null){if(\"start\"in _){if(E[\"start\"]=_[\"start\"],typeof E[\"start\"]!==\"function\")@throwTypeError(\"transformer.start should be a function\")}if(\"transform\"in _){if(E[\"transform\"]=_[\"transform\"],typeof E[\"transform\"]!==\"function\")@throwTypeError(\"transformer.transform should be a function\")}if(\"flush\"in _){if(E[\"flush\"]=_[\"flush\"],typeof E[\"flush\"]!==\"function\")@throwTypeError(\"transformer.flush should be a function\")}if(\"readableType\"in _)@throwRangeError(\"TransformStream transformer has a readableType\");if(\"writableType\"in _)@throwRangeError(\"TransformStream transformer has a writableType\")}const j=@extractHighWaterMark(u,0),F=@extractSizeAlgorithm(u),q=@extractHighWaterMark(B,1),G=@extractSizeAlgorithm(B),v=@newPromiseCapability(@Promise);if(@initializeTransformStream(this,v.@promise,q,G,j,F),@setUpTransformStreamDefaultControllerFromTransformer(this,_,E),(\"start\"in E)){const I=@getByIdDirectPrivate(this,\"controller\");(()=>@promiseInvokeOrNoopMethodNoCatch(_,E[\"start\"],[I]))().@then(()=>{v.@resolve.@call()},(J)=>{v.@reject.@call(@undefined,J)})}else v.@resolve.@call();return this})\n"; // readable const JSC::ConstructAbility s_transformStreamReadableCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -716,7 +716,7 @@ const JSC::ConstructorKind s_moduleRequireCodeConstructorKind = JSC::Constructor const JSC::ImplementationVisibility s_moduleRequireCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_moduleRequireCodeLength = 1035; static const JSC::Intrinsic s_moduleRequireCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_moduleRequireCode = "(function (M){\"use strict\";const L=@requireMap.@get(M)||@requireMap.@get(M=@resolveSync(M,this.path,!1));if(L)return @evaluateCommonJSModule(L),L.exports;if(M.endsWith(\".json\")||M.endsWith(\".toml\")||M.endsWith(\".node\"))return @internalRequire(M);let b=@Loader.registry.@get(M);if(b\?.evaluated&&(b.state\?\?0)>=@ModuleReady){const h=b.module,f=@Loader.getModuleNamespaceObject(h),r=f\?.[@commonJSSymbol]===0||f\?.default\?.[@commonJSSymbol]===0\?f.default:f.__esModule\?f:Object.create(f,{__esModule:{value:!0}});return @requireMap.@set(M,@createCommonJSModule(M,r,!0)),r}const _=@createCommonJSModule(M,{},!1);@requireMap.@set(M,_);var S=this.@require(M,_);if(S===-1){try{S=@requireESM(M)}catch(h){throw @requireMap.@delete(M),h}if(b=@Loader.registry.@get(M),b\?.evaluated&&(b.state\?\?0)>=@ModuleReady){const h=@Loader.getModuleNamespaceObject(b.module);return _.exports=h\?.[@commonJSSymbol]===0||h\?.default\?.[@commonJSSymbol]===0\?h.default:h.__esModule\?h:Object.create(h,{__esModule:{value:!0}})}}return @evaluateCommonJSModule(_),_.exports})\n"; +const char* const s_moduleRequireCode = "(function (M){\"use strict\";const S=@requireMap.@get(M)||@requireMap.@get(M=@resolveSync(M,this.path,!1));if(S)return @evaluateCommonJSModule(S),S.exports;if(M.endsWith(\".json\")||M.endsWith(\".toml\")||M.endsWith(\".node\"))return @internalRequire(M);let f=@Loader.registry.@get(M);if(f\?.evaluated&&(f.state\?\?0)>=@ModuleReady){const _=f.module,b=@Loader.getModuleNamespaceObject(_),r=b\?.[@commonJSSymbol]===0||b\?.default\?.[@commonJSSymbol]===0\?b.default:b.__esModule\?b:Object.create(b,{__esModule:{value:!0}});return @requireMap.@set(M,@createCommonJSModule(M,r,!0)),r}const L=@createCommonJSModule(M,{},!1);@requireMap.@set(M,L);var h=this.@require(M,L);if(h===-1){try{h=@requireESM(M)}catch(_){throw @requireMap.@delete(M),_}if(f=@Loader.registry.@get(M),f\?.evaluated&&(f.state\?\?0)>=@ModuleReady){const _=@Loader.getModuleNamespaceObject(f.module);return L.exports=_\?.[@commonJSSymbol]===0||_\?.default\?.[@commonJSSymbol]===0\?_.default:_.__esModule\?_:Object.create(_,{__esModule:{value:!0}})}}return @evaluateCommonJSModule(L),L.exports})\n"; // requireResolve const JSC::ConstructAbility s_moduleRequireResolveCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -846,7 +846,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeReadUIntLECodeConstructorKind = JS const JSC::ImplementationVisibility s_jsBufferPrototypeReadUIntLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_jsBufferPrototypeReadUIntLECodeLength = 445; static const JSC::Intrinsic s_jsBufferPrototypeReadUIntLECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeReadUIntLECode = "(function (a,r){\"use strict\";const d=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(r){case 1:return d.getUint8(a);case 2:return d.getUint16(a,!0);case 3:return d.getUint16(a,!0)+d.getUint8(a+2)*65536;case 4:return d.getUint32(a,!0);case 5:return d.getUint8(a+4)*4294967296+d.getUint32(a,!0);case 6:return d.getUint16(a+4,!0)*4294967296+d.getUint32(a,!0)}@throwRangeError(\"byteLength must be >= 1 and <= 6\")})\n"; +const char* const s_jsBufferPrototypeReadUIntLECode = "(function (a,d){\"use strict\";const r=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(d){case 1:return r.getUint8(a);case 2:return r.getUint16(a,!0);case 3:return r.getUint16(a,!0)+r.getUint8(a+2)*65536;case 4:return r.getUint32(a,!0);case 5:return r.getUint8(a+4)*4294967296+r.getUint32(a,!0);case 6:return r.getUint16(a+4,!0)*4294967296+r.getUint32(a,!0)}@throwRangeError(\"byteLength must be >= 1 and <= 6\")})\n"; // readUIntBE const JSC::ConstructAbility s_jsBufferPrototypeReadUIntBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1014,7 +1014,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteIntBECodeConstructorKind = JS const JSC::ImplementationVisibility s_jsBufferPrototypeWriteIntBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_jsBufferPrototypeWriteIntBECodeLength = 573; static const JSC::Intrinsic s_jsBufferPrototypeWriteIntBECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteIntBECode = "(function (r,c,E){\"use strict\";const d=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(E){case 1:{d.setInt8(c,r);break}case 2:{d.setInt16(c,r,!1);break}case 3:{d.setUint16(c+1,r&65535,!1),d.setInt8(c,Math.floor(r*0.0000152587890625));break}case 4:{d.setInt32(c,r,!1);break}case 5:{d.setUint32(c+1,r|0,!1),d.setInt8(c,Math.floor(r*0.00000000023283064365386964));break}case 6:{d.setUint32(c+2,r|0,!1),d.setInt16(c,Math.floor(r*0.00000000023283064365386964),!1);break}default:@throwRangeError(\"byteLength must be >= 1 and <= 6\")}return c+E})\n"; +const char* const s_jsBufferPrototypeWriteIntBECode = "(function (d,r,E){\"use strict\";const c=this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength);switch(E){case 1:{c.setInt8(r,d);break}case 2:{c.setInt16(r,d,!1);break}case 3:{c.setUint16(r+1,d&65535,!1),c.setInt8(r,Math.floor(d*0.0000152587890625));break}case 4:{c.setInt32(r,d,!1);break}case 5:{c.setUint32(r+1,d|0,!1),c.setInt8(r,Math.floor(d*0.00000000023283064365386964));break}case 6:{c.setUint32(r+2,d|0,!1),c.setInt16(r,Math.floor(d*0.00000000023283064365386964),!1);break}default:@throwRangeError(\"byteLength must be >= 1 and <= 6\")}return r+E})\n"; // writeUIntLE const JSC::ConstructAbility s_jsBufferPrototypeWriteUIntLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1038,7 +1038,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatLECodeConstructorKind = const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatLECodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_jsBufferPrototypeWriteFloatLECodeLength = 137; static const JSC::Intrinsic s_jsBufferPrototypeWriteFloatLECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteFloatLECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat32(d,c,!0),d+4})\n"; +const char* const s_jsBufferPrototypeWriteFloatLECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat32(c,d,!0),c+4})\n"; // writeFloatBE const JSC::ConstructAbility s_jsBufferPrototypeWriteFloatBECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1046,7 +1046,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeWriteFloatBECodeConstructorKind = const JSC::ImplementationVisibility s_jsBufferPrototypeWriteFloatBECodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_jsBufferPrototypeWriteFloatBECodeLength = 137; static const JSC::Intrinsic s_jsBufferPrototypeWriteFloatBECodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeWriteFloatBECode = "(function (c,d){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat32(d,c,!1),d+4})\n"; +const char* const s_jsBufferPrototypeWriteFloatBECode = "(function (d,c){\"use strict\";return(this.@dataView||=new DataView(this.buffer,this.byteOffset,this.byteLength)).setFloat32(c,d,!1),c+4})\n"; // writeDoubleLE const JSC::ConstructAbility s_jsBufferPrototypeWriteDoubleLECodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1150,7 +1150,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeBase64urlWriteCodeConstructorKind const JSC::ImplementationVisibility s_jsBufferPrototypeBase64urlWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_jsBufferPrototypeBase64urlWriteCodeLength = 70; static const JSC::Intrinsic s_jsBufferPrototypeBase64urlWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeBase64urlWriteCode = "(function (a,r,d){\"use strict\";return this.write(a,r,d,\"base64url\")})\n"; +const char* const s_jsBufferPrototypeBase64urlWriteCode = "(function (a,d,r){\"use strict\";return this.write(a,d,r,\"base64url\")})\n"; // hexWrite const JSC::ConstructAbility s_jsBufferPrototypeHexWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1238,7 +1238,7 @@ const JSC::ConstructorKind s_jsBufferPrototypeSliceCodeConstructorKind = JSC::Co const JSC::ImplementationVisibility s_jsBufferPrototypeSliceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_jsBufferPrototypeSliceCodeLength = 260; static const JSC::Intrinsic s_jsBufferPrototypeSliceCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferPrototypeSliceCode = "(function (c,p){\"use strict\";var{buffer:i,byteOffset:k,byteLength:m}=this;function q(x,z){if(x=@trunc(x),x===0||@isNaN(x))return 0;else if(x<0)return x+=z,x>0\?x:0;else return x<z\?x:z}var v=q(c,m),w=p!==@undefined\?q(p,m):m;return new @Buffer(i,k+v,w>v\?w-v:0)})\n"; +const char* const s_jsBufferPrototypeSliceCode = "(function (p,m){\"use strict\";var{buffer:c,byteOffset:k,byteLength:v}=this;function q(z,i){if(z=@trunc(z),z===0||@isNaN(z))return 0;else if(z<0)return z+=i,z>0\?z:0;else return z<i\?z:i}var w=q(p,v),x=m!==@undefined\?q(m,v):v;return new @Buffer(c,k+w,x>w\?x-w:0)})\n"; // parent const JSC::ConstructAbility s_jsBufferPrototypeParentCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1338,7 +1338,7 @@ const JSC::ConstructorKind s_consoleObjectAsyncIteratorCodeConstructorKind = JSC const JSC::ImplementationVisibility s_consoleObjectAsyncIteratorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_consoleObjectAsyncIteratorCodeLength = 577; static const JSC::Intrinsic s_consoleObjectAsyncIteratorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_consoleObjectAsyncIteratorCode = "(function (){\"use strict\";const w=async function*_(){var A=@Bun.stdin.stream().getReader(),F=new globalThis.TextDecoder(\"utf-8\",{fatal:!1}),H,J=@Bun.indexOfLine;try{while(!0){var K,m,L;const D=A.readMany();if(@isPromise(D))({done:K,value:m}=await D);else({done:K,value:m}=D);if(K){if(L)yield F.decode(L);return}var M;for(let z of m){if(M=z,L)M=@Buffer.concat([L,z]),L=null;var q=0,B=J(M,q);while(B!==-1)yield F.decode(M.subarray(q,B)),q=B+1,B=J(M,q);L=M.subarray(q)}}}catch(D){H=D}finally{if(A.releaseLock(),H)throw H}},G=globalThis.Symbol.asyncIterator;return this[G]=w,w()})\n"; +const char* const s_consoleObjectAsyncIteratorCode = "(function (){\"use strict\";const j=async function*w(){var _=@Bun.stdin.stream().getReader(),B=new globalThis.TextDecoder(\"utf-8\",{fatal:!1}),m,D=@Bun.indexOfLine;try{while(!0){var F,q,G;const L=_.readMany();if(@isPromise(L))({done:F,value:q}=await L);else({done:F,value:q}=L);if(F){if(G)yield B.decode(G);return}var H;for(let M of q){if(H=M,G)H=@Buffer.concat([G,M]),G=null;var J=0,K=D(H,J);while(K!==-1)yield B.decode(H.subarray(J,K)),J=K+1,K=D(H,J);G=H.subarray(J)}}}catch(L){m=L}finally{if(_.releaseLock(),m)throw m}},z=globalThis.Symbol.asyncIterator;return this[z]=j,j()})\n"; // write const JSC::ConstructAbility s_consoleObjectWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1346,7 +1346,7 @@ const JSC::ConstructorKind s_consoleObjectWriteCodeConstructorKind = JSC::Constr const JSC::ImplementationVisibility s_consoleObjectWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_consoleObjectWriteCodeLength = 310; static const JSC::Intrinsic s_consoleObjectWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_consoleObjectWriteCode = "(function (a){\"use strict\";var d=@getByIdDirectPrivate(this,\"writer\");if(!d){var _=@toLength(a\?.length\?\?0);d=@Bun.stdout.writer({highWaterMark:_>65536\?_:65536}),@putByIdDirectPrivate(this,\"writer\",d)}var b=d.write(a);const c=@argumentCount();for(var f=1;f<c;f++)b+=d.write(@argument(f));return d.flush(!0),b})\n"; +const char* const s_consoleObjectWriteCode = "(function (d){\"use strict\";var _=@getByIdDirectPrivate(this,\"writer\");if(!_){var b=@toLength(d\?.length\?\?0);_=@Bun.stdout.writer({highWaterMark:b>65536\?b:65536}),@putByIdDirectPrivate(this,\"writer\",_)}var c=_.write(d);const f=@argumentCount();for(var a=1;a<f;a++)c+=_.write(@argument(a));return _.flush(!0),c})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ @@ -1364,7 +1364,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamReaderGenericI const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeLength = 585; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamReaderGenericInitializeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamReaderGenericInitializeCode = "(function (_,i){\"use strict\";if(@putByIdDirectPrivate(_,\"ownerReadableStream\",i),@putByIdDirectPrivate(i,\"reader\",_),@getByIdDirectPrivate(i,\"state\")===@streamReadable)@putByIdDirectPrivate(_,\"closedPromiseCapability\",@newPromiseCapability(@Promise));else if(@getByIdDirectPrivate(i,\"state\")===@streamClosed)@putByIdDirectPrivate(_,\"closedPromiseCapability\",{@promise:@Promise.@resolve()});else @assert(@getByIdDirectPrivate(i,\"state\")===@streamErrored),@putByIdDirectPrivate(_,\"closedPromiseCapability\",{@promise:@newHandledRejectedPromise(@getByIdDirectPrivate(i,\"storedError\"))})})\n"; +const char* const s_readableStreamInternalsReadableStreamReaderGenericInitializeCode = "(function (i,_){\"use strict\";if(@putByIdDirectPrivate(i,\"ownerReadableStream\",_),@putByIdDirectPrivate(_,\"reader\",i),@getByIdDirectPrivate(_,\"state\")===@streamReadable)@putByIdDirectPrivate(i,\"closedPromiseCapability\",@newPromiseCapability(@Promise));else if(@getByIdDirectPrivate(_,\"state\")===@streamClosed)@putByIdDirectPrivate(i,\"closedPromiseCapability\",{@promise:@Promise.@resolve()});else @assert(@getByIdDirectPrivate(_,\"state\")===@streamErrored),@putByIdDirectPrivate(i,\"closedPromiseCapability\",{@promise:@newHandledRejectedPromise(@getByIdDirectPrivate(_,\"storedError\"))})})\n"; // privateInitializeReadableStreamDefaultController const JSC::ConstructAbility s_readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1404,7 +1404,7 @@ const JSC::ConstructorKind s_readableStreamInternalsSetupReadableStreamDefaultCo const JSC::ImplementationVisibility s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeLength = 523; static const JSC::Intrinsic s_readableStreamInternalsSetupReadableStreamDefaultControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsSetupReadableStreamDefaultControllerCode = "(function (_,w,f,b,q,v,x){\"use strict\";const B=new @ReadableStreamDefaultController(_,w,f,b,@isReadableStream),C=()=>@promiseInvokeOrNoopMethod(w,v,[B]),j=(D)=>@promiseInvokeOrNoopMethod(w,x,[D]);@putByIdDirectPrivate(B,\"pullAlgorithm\",C),@putByIdDirectPrivate(B,\"cancelAlgorithm\",j),@putByIdDirectPrivate(B,\"pull\",@readableStreamDefaultControllerPull),@putByIdDirectPrivate(B,\"cancel\",@readableStreamDefaultControllerCancel),@putByIdDirectPrivate(_,\"readableStreamController\",B),@readableStreamDefaultControllerStart(B)})\n"; +const char* const s_readableStreamInternalsSetupReadableStreamDefaultControllerCode = "(function (_,f,b,v,j,w,B){\"use strict\";const C=new @ReadableStreamDefaultController(_,f,b,v,@isReadableStream),q=()=>@promiseInvokeOrNoopMethod(f,w,[C]),D=(x)=>@promiseInvokeOrNoopMethod(f,B,[x]);@putByIdDirectPrivate(C,\"pullAlgorithm\",q),@putByIdDirectPrivate(C,\"cancelAlgorithm\",D),@putByIdDirectPrivate(C,\"pull\",@readableStreamDefaultControllerPull),@putByIdDirectPrivate(C,\"cancel\",@readableStreamDefaultControllerCancel),@putByIdDirectPrivate(_,\"readableStreamController\",C),@readableStreamDefaultControllerStart(C)})\n"; // createReadableStreamController const JSC::ConstructAbility s_readableStreamInternalsCreateReadableStreamControllerCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1412,7 +1412,7 @@ const JSC::ConstructorKind s_readableStreamInternalsCreateReadableStreamControll const JSC::ImplementationVisibility s_readableStreamInternalsCreateReadableStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsCreateReadableStreamControllerCodeLength = 671; static const JSC::Intrinsic s_readableStreamInternalsCreateReadableStreamControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsCreateReadableStreamControllerCode = "(function (v,w,A){\"use strict\";const C=w.type,b=@toString(C);if(b===\"bytes\"){if(A.highWaterMark===@undefined)A.highWaterMark=0;if(A.size!==@undefined)@throwRangeError(\"Strategy for a ReadableByteStreamController cannot have a size\");@putByIdDirectPrivate(v,\"readableStreamController\",new @ReadableByteStreamController(v,w,A.highWaterMark,@isReadableStream))}else if(b===\"direct\"){var f=A\?.highWaterMark;@initializeArrayBufferStream.@call(v,w,f)}else if(C===@undefined){if(A.highWaterMark===@undefined)A.highWaterMark=1;@setupReadableStreamDefaultController(v,w,A.size,A.highWaterMark,w.start,w.pull,w.cancel)}else @throwRangeError(\"Invalid type for underlying source\")})\n"; +const char* const s_readableStreamInternalsCreateReadableStreamControllerCode = "(function (w,C,A){\"use strict\";const b=C.type,f=@toString(b);if(f===\"bytes\"){if(A.highWaterMark===@undefined)A.highWaterMark=0;if(A.size!==@undefined)@throwRangeError(\"Strategy for a ReadableByteStreamController cannot have a size\");@putByIdDirectPrivate(w,\"readableStreamController\",new @ReadableByteStreamController(w,C,A.highWaterMark,@isReadableStream))}else if(f===\"direct\"){var v=A\?.highWaterMark;@initializeArrayBufferStream.@call(w,C,v)}else if(b===@undefined){if(A.highWaterMark===@undefined)A.highWaterMark=1;@setupReadableStreamDefaultController(w,C,A.size,A.highWaterMark,C.start,C.pull,C.cancel)}else @throwRangeError(\"Invalid type for underlying source\")})\n"; // readableStreamDefaultControllerStart const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1420,7 +1420,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControl const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerStartCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsReadableStreamDefaultControllerStartCodeLength = 465; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerStartCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamDefaultControllerStartCode = "(function (m){\"use strict\";if(@getByIdDirectPrivate(m,\"started\")!==-1)return;const B=@getByIdDirectPrivate(m,\"underlyingSource\"),a=B.start;@putByIdDirectPrivate(m,\"started\",0),@promiseInvokeOrNoopMethodNoCatch(B,a,[m]).@then(()=>{@putByIdDirectPrivate(m,\"started\",1),@assert(!@getByIdDirectPrivate(m,\"pulling\")),@assert(!@getByIdDirectPrivate(m,\"pullAgain\")),@readableStreamDefaultControllerCallPullIfNeeded(m)},(p)=>{@readableStreamDefaultControllerError(m,p)})})\n"; +const char* const s_readableStreamInternalsReadableStreamDefaultControllerStartCode = "(function (B){\"use strict\";if(@getByIdDirectPrivate(B,\"started\")!==-1)return;const a=@getByIdDirectPrivate(B,\"underlyingSource\"),p=a.start;@putByIdDirectPrivate(B,\"started\",0),@promiseInvokeOrNoopMethodNoCatch(a,p,[B]).@then(()=>{@putByIdDirectPrivate(B,\"started\",1),@assert(!@getByIdDirectPrivate(B,\"pulling\")),@assert(!@getByIdDirectPrivate(B,\"pullAgain\")),@readableStreamDefaultControllerCallPullIfNeeded(B)},(m)=>{@readableStreamDefaultControllerError(B,m)})})\n"; // readableStreamPipeToWritableStream const JSC::ConstructAbility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1428,7 +1428,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamPipeToWritable const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeLength = 1631; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamPipeToWritableStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamPipeToWritableStreamCode = "(function (D,x,_,z,f,B){\"use strict\";if(@assert(@isReadableStream(D)),@assert(@isWritableStream(x)),@assert(!@isReadableStreamLocked(D)),@assert(!@isWritableStreamLocked(x)),@assert(B===@undefined||@isAbortSignal(B)),@getByIdDirectPrivate(D,\"underlyingByteSource\")!==@undefined)return @Promise.@reject(\"Piping to a readable bytestream is not supported\");let E={source:D,destination:x,preventAbort:z,preventCancel:f,preventClose:_,signal:B};if(E.reader=@acquireReadableStreamDefaultReader(D),E.writer=@acquireWritableStreamDefaultWriter(x),@putByIdDirectPrivate(D,\"disturbed\",!0),E.finalized=!1,E.shuttingDown=!1,E.promiseCapability=@newPromiseCapability(@Promise),E.pendingReadPromiseCapability=@newPromiseCapability(@Promise),E.pendingReadPromiseCapability.@resolve.@call(),E.pendingWritePromise=@Promise.@resolve(),B!==@undefined){const F=(G)=>{if(E.finalized)return;@pipeToShutdownWithAction(E,()=>{const H=!E.preventAbort&&@getByIdDirectPrivate(E.destination,\"state\")===\"writable\"\?@writableStreamAbort(E.destination,G):@Promise.@resolve(),k=!E.preventCancel&&@getByIdDirectPrivate(E.source,\"state\")===@streamReadable\?@readableStreamCancel(E.source,G):@Promise.@resolve();let J=@newPromiseCapability(@Promise),K=!0,L=()=>{if(K){K=!1;return}J.@resolve.@call()},q=(w)=>{J.@reject.@call(@undefined,w)};return H.@then(L,q),k.@then(L,q),J.@promise},G)};if(@whenSignalAborted(B,F))return E.promiseCapability.@promise}return @pipeToErrorsMustBePropagatedForward(E),@pipeToErrorsMustBePropagatedBackward(E),@pipeToClosingMustBePropagatedForward(E),@pipeToClosingMustBePropagatedBackward(E),@pipeToLoop(E),E.promiseCapability.@promise})\n"; +const char* const s_readableStreamInternalsReadableStreamPipeToWritableStreamCode = "(function (D,w,_,x,f,z){\"use strict\";if(@assert(@isReadableStream(D)),@assert(@isWritableStream(w)),@assert(!@isReadableStreamLocked(D)),@assert(!@isWritableStreamLocked(w)),@assert(z===@undefined||@isAbortSignal(z)),@getByIdDirectPrivate(D,\"underlyingByteSource\")!==@undefined)return @Promise.@reject(\"Piping to a readable bytestream is not supported\");let E={source:D,destination:w,preventAbort:x,preventCancel:f,preventClose:_,signal:z};if(E.reader=@acquireReadableStreamDefaultReader(D),E.writer=@acquireWritableStreamDefaultWriter(w),@putByIdDirectPrivate(D,\"disturbed\",!0),E.finalized=!1,E.shuttingDown=!1,E.promiseCapability=@newPromiseCapability(@Promise),E.pendingReadPromiseCapability=@newPromiseCapability(@Promise),E.pendingReadPromiseCapability.@resolve.@call(),E.pendingWritePromise=@Promise.@resolve(),z!==@undefined){const B=(F)=>{if(E.finalized)return;@pipeToShutdownWithAction(E,()=>{const G=!E.preventAbort&&@getByIdDirectPrivate(E.destination,\"state\")===\"writable\"\?@writableStreamAbort(E.destination,F):@Promise.@resolve(),I=!E.preventCancel&&@getByIdDirectPrivate(E.source,\"state\")===@streamReadable\?@readableStreamCancel(E.source,F):@Promise.@resolve();let J=@newPromiseCapability(@Promise),K=!0,L=()=>{if(K){K=!1;return}J.@resolve.@call()},k=(q)=>{J.@reject.@call(@undefined,q)};return G.@then(L,k),I.@then(L,k),J.@promise},F)};if(@whenSignalAborted(z,B))return E.promiseCapability.@promise}return @pipeToErrorsMustBePropagatedForward(E),@pipeToErrorsMustBePropagatedBackward(E),@pipeToClosingMustBePropagatedForward(E),@pipeToClosingMustBePropagatedBackward(E),@pipeToLoop(E),E.promiseCapability.@promise})\n"; // pipeToLoop const JSC::ConstructAbility s_readableStreamInternalsPipeToLoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1436,7 +1436,7 @@ const JSC::ConstructorKind s_readableStreamInternalsPipeToLoopCodeConstructorKin const JSC::ImplementationVisibility s_readableStreamInternalsPipeToLoopCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsPipeToLoopCodeLength = 110; static const JSC::Intrinsic s_readableStreamInternalsPipeToLoopCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToLoopCode = "(function (c){\"use strict\";if(c.shuttingDown)return;@pipeToDoReadWrite(c).@then((d)=>{if(d)@pipeToLoop(c)})})\n"; +const char* const s_readableStreamInternalsPipeToLoopCode = "(function (d){\"use strict\";if(d.shuttingDown)return;@pipeToDoReadWrite(d).@then((c)=>{if(c)@pipeToLoop(d)})})\n"; // pipeToDoReadWrite const JSC::ConstructAbility s_readableStreamInternalsPipeToDoReadWriteCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1444,7 +1444,7 @@ const JSC::ConstructorKind s_readableStreamInternalsPipeToDoReadWriteCodeConstru const JSC::ImplementationVisibility s_readableStreamInternalsPipeToDoReadWriteCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsPipeToDoReadWriteCodeLength = 731; static const JSC::Intrinsic s_readableStreamInternalsPipeToDoReadWriteCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToDoReadWriteCode = "(function (m){\"use strict\";return @assert(!m.shuttingDown),m.pendingReadPromiseCapability=@newPromiseCapability(@Promise),@getByIdDirectPrivate(m.writer,\"readyPromise\").@promise.@then(()=>{if(m.shuttingDown){m.pendingReadPromiseCapability.@resolve.@call(@undefined,!1);return}@readableStreamDefaultReaderRead(m.reader).@then((_)=>{const d=!_.done&&@getByIdDirectPrivate(m.writer,\"stream\")!==@undefined;if(m.pendingReadPromiseCapability.@resolve.@call(@undefined,d),!d)return;m.pendingWritePromise=@writableStreamDefaultWriterWrite(m.writer,_.value)},(_)=>{m.pendingReadPromiseCapability.@resolve.@call(@undefined,!1)})},(_)=>{m.pendingReadPromiseCapability.@resolve.@call(@undefined,!1)}),m.pendingReadPromiseCapability.@promise})\n"; +const char* const s_readableStreamInternalsPipeToDoReadWriteCode = "(function (_){\"use strict\";return @assert(!_.shuttingDown),_.pendingReadPromiseCapability=@newPromiseCapability(@Promise),@getByIdDirectPrivate(_.writer,\"readyPromise\").@promise.@then(()=>{if(_.shuttingDown){_.pendingReadPromiseCapability.@resolve.@call(@undefined,!1);return}@readableStreamDefaultReaderRead(_.reader).@then((m)=>{const d=!m.done&&@getByIdDirectPrivate(_.writer,\"stream\")!==@undefined;if(_.pendingReadPromiseCapability.@resolve.@call(@undefined,d),!d)return;_.pendingWritePromise=@writableStreamDefaultWriterWrite(_.writer,m.value)},(m)=>{_.pendingReadPromiseCapability.@resolve.@call(@undefined,!1)})},(m)=>{_.pendingReadPromiseCapability.@resolve.@call(@undefined,!1)}),_.pendingReadPromiseCapability.@promise})\n"; // pipeToErrorsMustBePropagatedForward const JSC::ConstructAbility s_readableStreamInternalsPipeToErrorsMustBePropagatedForwardCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1484,7 +1484,7 @@ const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownWithActionCode const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownWithActionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsPipeToShutdownWithActionCodeLength = 458; static const JSC::Intrinsic s_readableStreamInternalsPipeToShutdownWithActionCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToShutdownWithActionCode = "(function (_,m){\"use strict\";if(_.shuttingDown)return;_.shuttingDown=!0;const b=arguments.length>2,d=arguments[2],g=()=>{m().@then(()=>{if(b)@pipeToFinalize(_,d);else @pipeToFinalize(_)},(j)=>{@pipeToFinalize(_,j)})};if(@getByIdDirectPrivate(_.destination,\"state\")===\"writable\"&&!@writableStreamCloseQueuedOrInFlight(_.destination)){_.pendingReadPromiseCapability.@promise.@then(()=>{_.pendingWritePromise.@then(g,g)},(h)=>@pipeToFinalize(_,h));return}g()})\n"; +const char* const s_readableStreamInternalsPipeToShutdownWithActionCode = "(function (_,m){\"use strict\";if(_.shuttingDown)return;_.shuttingDown=!0;const g=arguments.length>2,h=arguments[2],b=()=>{m().@then(()=>{if(g)@pipeToFinalize(_,h);else @pipeToFinalize(_)},(d)=>{@pipeToFinalize(_,d)})};if(@getByIdDirectPrivate(_.destination,\"state\")===\"writable\"&&!@writableStreamCloseQueuedOrInFlight(_.destination)){_.pendingReadPromiseCapability.@promise.@then(()=>{_.pendingWritePromise.@then(b,b)},(j)=>@pipeToFinalize(_,j));return}b()})\n"; // pipeToShutdown const JSC::ConstructAbility s_readableStreamInternalsPipeToShutdownCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1492,7 +1492,7 @@ const JSC::ConstructorKind s_readableStreamInternalsPipeToShutdownCodeConstructo const JSC::ImplementationVisibility s_readableStreamInternalsPipeToShutdownCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsPipeToShutdownCodeLength = 411; static const JSC::Intrinsic s_readableStreamInternalsPipeToShutdownCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsPipeToShutdownCode = "(function (_){\"use strict\";if(_.shuttingDown)return;_.shuttingDown=!0;const d=arguments.length>1,m=arguments[1],u=()=>{if(d)@pipeToFinalize(_,m);else @pipeToFinalize(_)};if(@getByIdDirectPrivate(_.destination,\"state\")===\"writable\"&&!@writableStreamCloseQueuedOrInFlight(_.destination)){_.pendingReadPromiseCapability.@promise.@then(()=>{_.pendingWritePromise.@then(u,u)},(I)=>@pipeToFinalize(_,I));return}u()})\n"; +const char* const s_readableStreamInternalsPipeToShutdownCode = "(function (_){\"use strict\";if(_.shuttingDown)return;_.shuttingDown=!0;const m=arguments.length>1,u=arguments[1],d=()=>{if(m)@pipeToFinalize(_,u);else @pipeToFinalize(_)};if(@getByIdDirectPrivate(_.destination,\"state\")===\"writable\"&&!@writableStreamCloseQueuedOrInFlight(_.destination)){_.pendingReadPromiseCapability.@promise.@then(()=>{_.pendingWritePromise.@then(d,d)},(I)=>@pipeToFinalize(_,I));return}d()})\n"; // pipeToFinalize const JSC::ConstructAbility s_readableStreamInternalsPipeToFinalizeCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1508,7 +1508,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeCodeConstru const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsReadableStreamTeeCodeLength = 1104; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamTeeCode = "(function (f,k){\"use strict\";@assert(@isReadableStream(f)),@assert(typeof k===\"boolean\");var i=@getByIdDirectPrivate(f,\"start\");if(i)@putByIdDirectPrivate(f,\"start\",@undefined),i();const q=new @ReadableStreamDefaultReader(f),_={closedOrErrored:!1,canceled1:!1,canceled2:!1,reason1:@undefined,reason2:@undefined};_.cancelPromiseCapability=@newPromiseCapability(@Promise);const v=@readableStreamTeePullFunction(_,q,k),g={};@putByIdDirectPrivate(g,\"pull\",v),@putByIdDirectPrivate(g,\"cancel\",@readableStreamTeeBranch1CancelFunction(_,f));const w={};@putByIdDirectPrivate(w,\"pull\",v),@putByIdDirectPrivate(w,\"cancel\",@readableStreamTeeBranch2CancelFunction(_,f));const x=new @ReadableStream(g),j=new @ReadableStream(w);return @getByIdDirectPrivate(q,\"closedPromiseCapability\").@promise.@then(@undefined,function(y){if(_.closedOrErrored)return;if(@readableStreamDefaultControllerError(x.@readableStreamController,y),@readableStreamDefaultControllerError(j.@readableStreamController,y),_.closedOrErrored=!0,!_.canceled1||!_.canceled2)_.cancelPromiseCapability.@resolve.@call()}),_.branch1=x,_.branch2=j,[x,j]})\n"; +const char* const s_readableStreamInternalsReadableStreamTeeCode = "(function (_,f){\"use strict\";@assert(@isReadableStream(_)),@assert(typeof f===\"boolean\");var g=@getByIdDirectPrivate(_,\"start\");if(g)@putByIdDirectPrivate(_,\"start\",@undefined),g();const j=new @ReadableStreamDefaultReader(_),k={closedOrErrored:!1,canceled1:!1,canceled2:!1,reason1:@undefined,reason2:@undefined};k.cancelPromiseCapability=@newPromiseCapability(@Promise);const q=@readableStreamTeePullFunction(k,j,f),v={};@putByIdDirectPrivate(v,\"pull\",q),@putByIdDirectPrivate(v,\"cancel\",@readableStreamTeeBranch1CancelFunction(k,_));const w={};@putByIdDirectPrivate(w,\"pull\",q),@putByIdDirectPrivate(w,\"cancel\",@readableStreamTeeBranch2CancelFunction(k,_));const x=new @ReadableStream(v),y=new @ReadableStream(w);return @getByIdDirectPrivate(j,\"closedPromiseCapability\").@promise.@then(@undefined,function(i){if(k.closedOrErrored)return;if(@readableStreamDefaultControllerError(x.@readableStreamController,i),@readableStreamDefaultControllerError(y.@readableStreamController,i),k.closedOrErrored=!0,!k.canceled1||!k.canceled2)k.cancelPromiseCapability.@resolve.@call()}),k.branch1=x,k.branch2=y,[x,y]})\n"; // readableStreamTeePullFunction const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeePullFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1516,7 +1516,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeePullFunctio const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeePullFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsReadableStreamTeePullFunctionCodeLength = 764; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeePullFunctionCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamTeePullFunctionCode = "(function (i,f,m){\"use strict\";return function(){@Promise.prototype.@then.@call(@readableStreamDefaultReaderRead(f),function(_){if(@assert(@isObject(_)),@assert(typeof _.done===\"boolean\"),_.done&&!i.closedOrErrored){if(!i.canceled1)@readableStreamDefaultControllerClose(i.branch1.@readableStreamController);if(!i.canceled2)@readableStreamDefaultControllerClose(i.branch2.@readableStreamController);if(i.closedOrErrored=!0,!i.canceled1||!i.canceled2)i.cancelPromiseCapability.@resolve.@call()}if(i.closedOrErrored)return;if(!i.canceled1)@readableStreamDefaultControllerEnqueue(i.branch1.@readableStreamController,_.value);if(!i.canceled2)@readableStreamDefaultControllerEnqueue(i.branch2.@readableStreamController,m\?@structuredCloneForStream(_.value):_.value)})}})\n"; +const char* const s_readableStreamInternalsReadableStreamTeePullFunctionCode = "(function (i,m,_){\"use strict\";return function(){@Promise.prototype.@then.@call(@readableStreamDefaultReaderRead(m),function(f){if(@assert(@isObject(f)),@assert(typeof f.done===\"boolean\"),f.done&&!i.closedOrErrored){if(!i.canceled1)@readableStreamDefaultControllerClose(i.branch1.@readableStreamController);if(!i.canceled2)@readableStreamDefaultControllerClose(i.branch2.@readableStreamController);if(i.closedOrErrored=!0,!i.canceled1||!i.canceled2)i.cancelPromiseCapability.@resolve.@call()}if(i.closedOrErrored)return;if(!i.canceled1)@readableStreamDefaultControllerEnqueue(i.branch1.@readableStreamController,f.value);if(!i.canceled2)@readableStreamDefaultControllerEnqueue(i.branch2.@readableStreamController,_\?@structuredCloneForStream(f.value):f.value)})}})\n"; // readableStreamTeeBranch1CancelFunction const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1524,7 +1524,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamTeeBranch1Canc const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeLength = 258; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode = "(function (c,d){\"use strict\";return function(i){if(c.canceled1=!0,c.reason1=i,c.canceled2)@readableStreamCancel(d,[c.reason1,c.reason2]).@then(c.cancelPromiseCapability.@resolve,c.cancelPromiseCapability.@reject);return c.cancelPromiseCapability.@promise}})\n"; +const char* const s_readableStreamInternalsReadableStreamTeeBranch1CancelFunctionCode = "(function (c,i){\"use strict\";return function(d){if(c.canceled1=!0,c.reason1=d,c.canceled2)@readableStreamCancel(i,[c.reason1,c.reason2]).@then(c.cancelPromiseCapability.@resolve,c.cancelPromiseCapability.@reject);return c.cancelPromiseCapability.@promise}})\n"; // readableStreamTeeBranch2CancelFunction const JSC::ConstructAbility s_readableStreamInternalsReadableStreamTeeBranch2CancelFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1564,7 +1564,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadDirectStreamCodeConstruc const JSC::ImplementationVisibility s_readableStreamInternalsReadDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsReadDirectStreamCodeLength = 900; static const JSC::Intrinsic s_readableStreamInternalsReadDirectStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadDirectStreamCode = "(function (j,v,w){\"use strict\";@putByIdDirectPrivate(j,\"underlyingSource\",@undefined),@putByIdDirectPrivate(j,\"start\",@undefined);function x(f,A){if(A&&w\?.cancel){try{var B=w.cancel(A);@markPromiseAsHandled(B)}catch(q){}w=@undefined}if(f){if(@putByIdDirectPrivate(f,\"readableStreamController\",@undefined),@putByIdDirectPrivate(f,\"reader\",@undefined),A)@putByIdDirectPrivate(f,\"state\",@streamErrored),@putByIdDirectPrivate(f,\"storedError\",A);else @putByIdDirectPrivate(f,\"state\",@streamClosed);f=@undefined}}if(!w.pull){x();return}if(!@isCallable(w.pull)){x(),@throwTypeError(\"pull is not a function\");return}@putByIdDirectPrivate(j,\"readableStreamController\",v);const _=@getByIdDirectPrivate(j,\"highWaterMark\");v.start({highWaterMark:!_||_<64\?64:_}),@startDirectStream.@call(v,j,w.pull,x),@putByIdDirectPrivate(j,\"reader\",{});var z=w.pull(v);if(v=@undefined,z&&@isPromise(z))return z.@then(()=>{})})\n"; +const char* const s_readableStreamInternalsReadDirectStreamCode = "(function (j,w,_){\"use strict\";@putByIdDirectPrivate(j,\"underlyingSource\",@undefined),@putByIdDirectPrivate(j,\"start\",@undefined);function x(q,A){if(A&&_\?.cancel){try{var B=_.cancel(A);@markPromiseAsHandled(B)}catch(v){}_=@undefined}if(q){if(@putByIdDirectPrivate(q,\"readableStreamController\",@undefined),@putByIdDirectPrivate(q,\"reader\",@undefined),A)@putByIdDirectPrivate(q,\"state\",@streamErrored),@putByIdDirectPrivate(q,\"storedError\",A);else @putByIdDirectPrivate(q,\"state\",@streamClosed);q=@undefined}}if(!_.pull){x();return}if(!@isCallable(_.pull)){x(),@throwTypeError(\"pull is not a function\");return}@putByIdDirectPrivate(j,\"readableStreamController\",w);const f=@getByIdDirectPrivate(j,\"highWaterMark\");w.start({highWaterMark:!f||f<64\?64:f}),@startDirectStream.@call(w,j,_.pull,x),@putByIdDirectPrivate(j,\"reader\",{});var z=_.pull(w);if(w=@undefined,z&&@isPromise(z))return z.@then(()=>{})})\n"; // assignToStream const JSC::ConstructAbility s_readableStreamInternalsAssignToStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1580,7 +1580,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadStreamIntoSinkCodeConstr const JSC::ImplementationVisibility s_readableStreamInternalsReadStreamIntoSinkCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsReadStreamIntoSinkCodeLength = 1395; static const JSC::Intrinsic s_readableStreamInternalsReadStreamIntoSinkCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadStreamIntoSinkCode = "(async function (_,E,c){\"use strict\";var f=!1,z=!1;try{var D=_.getReader(),F=D.readMany();if(F&&@isPromise(F))F=await F;if(F.done)return f=!0,E.end();var G=F.value.length;const q=@getByIdDirectPrivate(_,\"highWaterMark\");if(c)@startDirectStream.@call(E,_,@undefined,()=>!z&&@markPromiseAsHandled(_.cancel()));E.start({highWaterMark:q||0});for(var H=0,I=F.value,J=F.value.length;H<J;H++)E.write(I[H]);var K=@getByIdDirectPrivate(_,\"state\");if(K===@streamClosed)return f=!0,E.end();while(!0){var{value:P,done:A}=await D.read();if(A)return f=!0,E.end();E.write(P)}}catch(q){z=!0;try{D=@undefined;const x=_.cancel(q);@markPromiseAsHandled(x)}catch(x){}if(E&&!f){f=!0;try{E.close(q)}catch(x){throw new globalThis.AggregateError([q,x])}}throw q}finally{if(D){try{D.releaseLock()}catch(x){}D=@undefined}E=@undefined;var K=@getByIdDirectPrivate(_,\"state\");if(_){var B=@getByIdDirectPrivate(_,\"readableStreamController\");if(B){if(@getByIdDirectPrivate(B,\"underlyingSource\"))@putByIdDirectPrivate(B,\"underlyingSource\",@undefined);if(@getByIdDirectPrivate(B,\"controlledReadableStream\"))@putByIdDirectPrivate(B,\"controlledReadableStream\",@undefined);if(@putByIdDirectPrivate(_,\"readableStreamController\",null),@getByIdDirectPrivate(_,\"underlyingSource\"))@putByIdDirectPrivate(_,\"underlyingSource\",@undefined);B=@undefined}if(!z&&K!==@streamClosed&&K!==@streamErrored)@readableStreamClose(_);_=@undefined}}})\n"; +const char* const s_readableStreamInternalsReadStreamIntoSinkCode = "(async function (f,I,q){\"use strict\";var z=!1,A=!1;try{var B=f.getReader(),D=B.readMany();if(D&&@isPromise(D))D=await D;if(D.done)return z=!0,I.end();var E=D.value.length;const J=@getByIdDirectPrivate(f,\"highWaterMark\");if(q)@startDirectStream.@call(I,f,@undefined,()=>!A&&@markPromiseAsHandled(f.cancel()));I.start({highWaterMark:J||0});for(var F=0,G=D.value,_=D.value.length;F<_;F++)I.write(G[F]);var c=@getByIdDirectPrivate(f,\"state\");if(c===@streamClosed)return z=!0,I.end();while(!0){var{value:P,done:x}=await B.read();if(x)return z=!0,I.end();I.write(P)}}catch(J){A=!0;try{B=@undefined;const K=f.cancel(J);@markPromiseAsHandled(K)}catch(K){}if(I&&!z){z=!0;try{I.close(J)}catch(K){throw new globalThis.AggregateError([J,K])}}throw J}finally{if(B){try{B.releaseLock()}catch(K){}B=@undefined}I=@undefined;var c=@getByIdDirectPrivate(f,\"state\");if(f){var H=@getByIdDirectPrivate(f,\"readableStreamController\");if(H){if(@getByIdDirectPrivate(H,\"underlyingSource\"))@putByIdDirectPrivate(H,\"underlyingSource\",@undefined);if(@getByIdDirectPrivate(H,\"controlledReadableStream\"))@putByIdDirectPrivate(H,\"controlledReadableStream\",@undefined);if(@putByIdDirectPrivate(f,\"readableStreamController\",null),@getByIdDirectPrivate(f,\"underlyingSource\"))@putByIdDirectPrivate(f,\"underlyingSource\",@undefined);H=@undefined}if(!A&&c!==@streamClosed&&c!==@streamErrored)@readableStreamClose(f);f=@undefined}}})\n"; // handleDirectStreamError const JSC::ConstructAbility s_readableStreamInternalsHandleDirectStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1604,7 +1604,7 @@ const JSC::ConstructorKind s_readableStreamInternalsOnPullDirectStreamCodeConstr const JSC::ImplementationVisibility s_readableStreamInternalsOnPullDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsOnPullDirectStreamCodeLength = 785; static const JSC::Intrinsic s_readableStreamInternalsOnPullDirectStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsOnPullDirectStreamCode = "(function (g){\"use strict\";var i=g.@controlledReadableStream;if(!i||@getByIdDirectPrivate(i,\"state\")!==@streamReadable)return;if(g._deferClose===-1)return;g._deferClose=-1,g._deferFlush=-1;var y,_;try{var h=g.@underlyingSource.pull(g);if(h&&@isPromise(h)){if(g._handleError===@undefined)g._handleError=@handleDirectStreamErrorReject.bind(g);@Promise.prototype.catch.@call(h,g._handleError)}}catch(b){return @handleDirectStreamErrorReject.@call(g,b)}finally{y=g._deferClose,_=g._deferFlush,g._deferFlush=g._deferClose=0}var j;if(g._pendingRead===@undefined)g._pendingRead=j=@newPromise();else j=@readableStreamAddReadRequest(i);if(y===1){var k=g._deferCloseReason;return g._deferCloseReason=@undefined,@onCloseDirectStream.@call(g,k),j}if(_===1)@onFlushDirectStream.@call(g);return j})\n"; +const char* const s_readableStreamInternalsOnPullDirectStreamCode = "(function (g){\"use strict\";var i=g.@controlledReadableStream;if(!i||@getByIdDirectPrivate(i,\"state\")!==@streamReadable)return;if(g._deferClose===-1)return;g._deferClose=-1,g._deferFlush=-1;var y,_;try{var j=g.@underlyingSource.pull(g);if(j&&@isPromise(j)){if(g._handleError===@undefined)g._handleError=@handleDirectStreamErrorReject.bind(g);@Promise.prototype.catch.@call(j,g._handleError)}}catch(b){return @handleDirectStreamErrorReject.@call(g,b)}finally{y=g._deferClose,_=g._deferFlush,g._deferFlush=g._deferClose=0}var k;if(g._pendingRead===@undefined)g._pendingRead=k=@newPromise();else k=@readableStreamAddReadRequest(i);if(y===1){var h=g._deferCloseReason;return g._deferCloseReason=@undefined,@onCloseDirectStream.@call(g,h),k}if(_===1)@onFlushDirectStream.@call(g);return k})\n"; // noopDoneFunction const JSC::ConstructAbility s_readableStreamInternalsNoopDoneFunctionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1628,7 +1628,7 @@ const JSC::ConstructorKind s_readableStreamInternalsOnCloseDirectStreamCodeConst const JSC::ImplementationVisibility s_readableStreamInternalsOnCloseDirectStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsOnCloseDirectStreamCodeLength = 1460; static const JSC::Intrinsic s_readableStreamInternalsOnCloseDirectStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsOnCloseDirectStreamCode = "(function (v){\"use strict\";var y=this.@controlledReadableStream;if(!y||@getByIdDirectPrivate(y,\"state\")!==@streamReadable)return;if(this._deferClose!==0){this._deferClose=1,this._deferCloseReason=v;return}if(@putByIdDirectPrivate(y,\"state\",@streamClosing),typeof this.@underlyingSource.close===\"function\")try{this.@underlyingSource.close.@call(this.@underlyingSource,v)}catch(C){}var S;try{S=this.@sink.end(),@putByIdDirectPrivate(this,\"sink\",@undefined)}catch(C){if(this._pendingRead){var B=this._pendingRead;this._pendingRead=@undefined,@rejectPromise(B,C)}@readableStreamError(y,C);return}this.error=this.flush=this.write=this.close=this.end=@onReadableStreamDirectControllerClosed;var j=@getByIdDirectPrivate(y,\"reader\");if(j&&@isReadableStreamDefaultReader(j)){var c=this._pendingRead;if(c&&@isPromise(c)&&S\?.byteLength){this._pendingRead=@undefined,@fulfillPromise(c,{value:S,done:!1}),@readableStreamClose(y);return}}if(S\?.byteLength){var b=@getByIdDirectPrivate(j,\"readRequests\");if(b\?.isNotEmpty()){@readableStreamFulfillReadRequest(y,S,!1),@readableStreamClose(y);return}@putByIdDirectPrivate(y,\"state\",@streamReadable),this.@pull=()=>{var C=@createFulfilledPromise({value:S,done:!1});return S=@undefined,@readableStreamClose(y),y=@undefined,C}}else if(this._pendingRead){var B=this._pendingRead;this._pendingRead=@undefined,@putByIdDirectPrivate(this,\"pull\",@noopDoneFunction),@fulfillPromise(B,{value:@undefined,done:!0})}@readableStreamClose(y)})\n"; +const char* const s_readableStreamInternalsOnCloseDirectStreamCode = "(function (c){\"use strict\";var v=this.@controlledReadableStream;if(!v||@getByIdDirectPrivate(v,\"state\")!==@streamReadable)return;if(this._deferClose!==0){this._deferClose=1,this._deferCloseReason=c;return}if(@putByIdDirectPrivate(v,\"state\",@streamClosing),typeof this.@underlyingSource.close===\"function\")try{this.@underlyingSource.close.@call(this.@underlyingSource,c)}catch(j){}var b;try{b=this.@sink.end(),@putByIdDirectPrivate(this,\"sink\",@undefined)}catch(j){if(this._pendingRead){var y=this._pendingRead;this._pendingRead=@undefined,@rejectPromise(y,j)}@readableStreamError(v,j);return}this.error=this.flush=this.write=this.close=this.end=@onReadableStreamDirectControllerClosed;var B=@getByIdDirectPrivate(v,\"reader\");if(B&&@isReadableStreamDefaultReader(B)){var C=this._pendingRead;if(C&&@isPromise(C)&&b\?.byteLength){this._pendingRead=@undefined,@fulfillPromise(C,{value:b,done:!1}),@readableStreamClose(v);return}}if(b\?.byteLength){var S=@getByIdDirectPrivate(B,\"readRequests\");if(S\?.isNotEmpty()){@readableStreamFulfillReadRequest(v,b,!1),@readableStreamClose(v);return}@putByIdDirectPrivate(v,\"state\",@streamReadable),this.@pull=()=>{var j=@createFulfilledPromise({value:b,done:!1});return b=@undefined,@readableStreamClose(v),v=@undefined,j}}else if(this._pendingRead){var y=this._pendingRead;this._pendingRead=@undefined,@putByIdDirectPrivate(this,\"pull\",@noopDoneFunction),@fulfillPromise(y,{value:@undefined,done:!0})}@readableStreamClose(v)})\n"; // onFlushDirectStream const JSC::ConstructAbility s_readableStreamInternalsOnFlushDirectStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1644,7 +1644,7 @@ const JSC::ConstructorKind s_readableStreamInternalsCreateTextStreamCodeConstruc const JSC::ImplementationVisibility s_readableStreamInternalsCreateTextStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsCreateTextStreamCodeLength = 984; static const JSC::Intrinsic s_readableStreamInternalsCreateTextStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsCreateTextStreamCode = "(function (v){\"use strict\";var x,z=[],A=!1,j=!1,E=\"\",q=@toLength(0),F=@newPromiseCapability(@Promise),G=!1;return x={start(){},write(w){if(typeof w===\"string\"){var C=@toLength(w.length);if(C>0)E+=w,A=!0,q+=C;return C}if(!w||!(@ArrayBuffer.@isView(w)||w instanceof @ArrayBuffer))@throwTypeError(\"Expected text, ArrayBuffer or ArrayBufferView\");const _=@toLength(w.byteLength);if(_>0)if(j=!0,E.length>0)@arrayPush(z,E,w),E=\"\";else @arrayPush(z,w);return q+=_,_},flush(){return 0},end(){if(G)return\"\";return x.fulfill()},fulfill(){G=!0;const w=x.finishInternal();return @fulfillPromise(F.@promise,w),w},finishInternal(){if(!A&&!j)return\"\";if(A&&!j)return E;if(j&&!A)return new globalThis.TextDecoder().decode(@Bun.concatArrayBuffers(z));var w=new @Bun.ArrayBufferSink;w.start({highWaterMark:q,asUint8Array:!0});for(let C of z)w.write(C);if(z.length=0,E.length>0)w.write(E),E=\"\";return new globalThis.TextDecoder().decode(w.end())},close(){try{if(!G)G=!0,x.fulfill()}catch(w){}}},[x,F]})\n"; +const char* const s_readableStreamInternalsCreateTextStreamCode = "(function (j){\"use strict\";var x,w=[],z=!1,_=!1,A=\"\",q=@toLength(0),C=@newPromiseCapability(@Promise),E=!1;return x={start(){},write(v){if(typeof v===\"string\"){var F=@toLength(v.length);if(F>0)A+=v,z=!0,q+=F;return F}if(!v||!(@ArrayBuffer.@isView(v)||v instanceof @ArrayBuffer))@throwTypeError(\"Expected text, ArrayBuffer or ArrayBufferView\");const G=@toLength(v.byteLength);if(G>0)if(_=!0,A.length>0)@arrayPush(w,A,v),A=\"\";else @arrayPush(w,v);return q+=G,G},flush(){return 0},end(){if(E)return\"\";return x.fulfill()},fulfill(){E=!0;const v=x.finishInternal();return @fulfillPromise(C.@promise,v),v},finishInternal(){if(!z&&!_)return\"\";if(z&&!_)return A;if(_&&!z)return new globalThis.TextDecoder().decode(@Bun.concatArrayBuffers(w));var v=new @Bun.ArrayBufferSink;v.start({highWaterMark:q,asUint8Array:!0});for(let F of w)v.write(F);if(w.length=0,A.length>0)v.write(A),A=\"\";return new globalThis.TextDecoder().decode(v.end())},close(){try{if(!E)E=!0,x.fulfill()}catch(v){}}},[x,C]})\n"; // initializeTextStream const JSC::ConstructAbility s_readableStreamInternalsInitializeTextStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1660,7 +1660,7 @@ const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayStreamCodeCon const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsInitializeArrayStreamCodeLength = 797; static const JSC::Intrinsic s_readableStreamInternalsInitializeArrayStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsInitializeArrayStreamCode = "(function (_,j){\"use strict\";var t=[],p=@newPromiseCapability(@Promise),b=!1;function d(){return b=!0,p.@resolve.@call(@undefined,t),t}var m={start(){},write(v){return @arrayPush(t,v),v.byteLength||v.length},flush(){return 0},end(){if(b)return[];return d()},close(){if(!b)d()}},q={@underlyingSource:_,@pull:@onPullDirectStream,@controlledReadableStream:this,@sink:m,close:@onCloseDirectStream,write:m.write,error:@handleDirectStreamError,end:@onCloseDirectStream,@close:@onCloseDirectStream,flush:@onFlushDirectStream,_pendingRead:@undefined,_deferClose:0,_deferFlush:0,_deferCloseReason:@undefined,_handleError:@undefined};return @putByIdDirectPrivate(this,\"readableStreamController\",q),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"start\",@undefined),p})\n"; +const char* const s_readableStreamInternalsInitializeArrayStreamCode = "(function (_,b){\"use strict\";var j=[],t=@newPromiseCapability(@Promise),p=!1;function d(){return p=!0,t.@resolve.@call(@undefined,j),j}var m={start(){},write(v){return @arrayPush(j,v),v.byteLength||v.length},flush(){return 0},end(){if(p)return[];return d()},close(){if(!p)d()}},q={@underlyingSource:_,@pull:@onPullDirectStream,@controlledReadableStream:this,@sink:m,close:@onCloseDirectStream,write:m.write,error:@handleDirectStreamError,end:@onCloseDirectStream,@close:@onCloseDirectStream,flush:@onFlushDirectStream,_pendingRead:@undefined,_deferClose:0,_deferFlush:0,_deferCloseReason:@undefined,_handleError:@undefined};return @putByIdDirectPrivate(this,\"readableStreamController\",q),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"start\",@undefined),t})\n"; // initializeArrayBufferStream const JSC::ConstructAbility s_readableStreamInternalsInitializeArrayBufferStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1668,7 +1668,7 @@ const JSC::ConstructorKind s_readableStreamInternalsInitializeArrayBufferStreamC const JSC::ImplementationVisibility s_readableStreamInternalsInitializeArrayBufferStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsInitializeArrayBufferStreamCodeLength = 690; static const JSC::Intrinsic s_readableStreamInternalsInitializeArrayBufferStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsInitializeArrayBufferStreamCode = "(function (_,m){\"use strict\";var D=m&&typeof m===\"number\"\?{highWaterMark:m,stream:!0,asUint8Array:!0}:{stream:!0,asUint8Array:!0},w=new @Bun.ArrayBufferSink;w.start(D);var b={@underlyingSource:_,@pull:@onPullDirectStream,@controlledReadableStream:this,@sink:w,close:@onCloseDirectStream,write:w.write.bind(w),error:@handleDirectStreamError,end:@onCloseDirectStream,@close:@onCloseDirectStream,flush:@onFlushDirectStream,_pendingRead:@undefined,_deferClose:0,_deferFlush:0,_deferCloseReason:@undefined,_handleError:@undefined};@putByIdDirectPrivate(this,\"readableStreamController\",b),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"start\",@undefined)})\n"; +const char* const s_readableStreamInternalsInitializeArrayBufferStreamCode = "(function (_,m){\"use strict\";var w=m&&typeof m===\"number\"\?{highWaterMark:m,stream:!0,asUint8Array:!0}:{stream:!0,asUint8Array:!0},D=new @Bun.ArrayBufferSink;D.start(w);var b={@underlyingSource:_,@pull:@onPullDirectStream,@controlledReadableStream:this,@sink:D,close:@onCloseDirectStream,write:D.write.bind(D),error:@handleDirectStreamError,end:@onCloseDirectStream,@close:@onCloseDirectStream,flush:@onFlushDirectStream,_pendingRead:@undefined,_deferClose:0,_deferFlush:0,_deferCloseReason:@undefined,_handleError:@undefined};@putByIdDirectPrivate(this,\"readableStreamController\",b),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"start\",@undefined)})\n"; // readableStreamError const JSC::ConstructAbility s_readableStreamInternalsReadableStreamErrorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1676,7 +1676,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamErrorCodeConst const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsReadableStreamErrorCodeLength = 840; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamErrorCode = "(function (_,i){\"use strict\";@assert(@isReadableStream(_)),@assert(@getByIdDirectPrivate(_,\"state\")===@streamReadable),@putByIdDirectPrivate(_,\"state\",@streamErrored),@putByIdDirectPrivate(_,\"storedError\",i);const c=@getByIdDirectPrivate(_,\"reader\");if(!c)return;if(@isReadableStreamDefaultReader(c)){const h=@getByIdDirectPrivate(c,\"readRequests\");@putByIdDirectPrivate(c,\"readRequests\",@createFIFO());for(var n=h.shift();n;n=h.shift())@rejectPromise(n,i)}else{@assert(@isReadableStreamBYOBReader(c));const h=@getByIdDirectPrivate(c,\"readIntoRequests\");@putByIdDirectPrivate(c,\"readIntoRequests\",@createFIFO());for(var n=h.shift();n;n=h.shift())@rejectPromise(n,i)}@getByIdDirectPrivate(c,\"closedPromiseCapability\").@reject.@call(@undefined,i);const f=@getByIdDirectPrivate(c,\"closedPromiseCapability\").@promise;@markPromiseAsHandled(f)})\n"; +const char* const s_readableStreamInternalsReadableStreamErrorCode = "(function (i,c){\"use strict\";@assert(@isReadableStream(i)),@assert(@getByIdDirectPrivate(i,\"state\")===@streamReadable),@putByIdDirectPrivate(i,\"state\",@streamErrored),@putByIdDirectPrivate(i,\"storedError\",c);const n=@getByIdDirectPrivate(i,\"reader\");if(!n)return;if(@isReadableStreamDefaultReader(n)){const _=@getByIdDirectPrivate(n,\"readRequests\");@putByIdDirectPrivate(n,\"readRequests\",@createFIFO());for(var f=_.shift();f;f=_.shift())@rejectPromise(f,c)}else{@assert(@isReadableStreamBYOBReader(n));const _=@getByIdDirectPrivate(n,\"readIntoRequests\");@putByIdDirectPrivate(n,\"readIntoRequests\",@createFIFO());for(var f=_.shift();f;f=_.shift())@rejectPromise(f,c)}@getByIdDirectPrivate(n,\"closedPromiseCapability\").@reject.@call(@undefined,c);const v=@getByIdDirectPrivate(n,\"closedPromiseCapability\").@promise;@markPromiseAsHandled(v)})\n"; // readableStreamDefaultControllerShouldCallPull const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultControllerShouldCallPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1772,7 +1772,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefaultControl const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeLength = 659; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCode = "(function (_,d){\"use strict\";const D=@getByIdDirectPrivate(_,\"controlledReadableStream\");if(@assert(@readableStreamDefaultControllerCanCloseOrEnqueue(_)),@isReadableStreamLocked(D)&&@getByIdDirectPrivate(@getByIdDirectPrivate(D,\"reader\"),\"readRequests\")\?.isNotEmpty()){@readableStreamFulfillReadRequest(D,d,!1),@readableStreamDefaultControllerCallPullIfNeeded(_);return}try{let E=1;if(@getByIdDirectPrivate(_,\"strategy\").size!==@undefined)E=@getByIdDirectPrivate(_,\"strategy\").size(d);@enqueueValueWithSize(@getByIdDirectPrivate(_,\"queue\"),d,E)}catch(E){throw @readableStreamDefaultControllerError(_,E),E}@readableStreamDefaultControllerCallPullIfNeeded(_)})\n"; +const char* const s_readableStreamInternalsReadableStreamDefaultControllerEnqueueCode = "(function (_,d){\"use strict\";const E=@getByIdDirectPrivate(_,\"controlledReadableStream\");if(@assert(@readableStreamDefaultControllerCanCloseOrEnqueue(_)),@isReadableStreamLocked(E)&&@getByIdDirectPrivate(@getByIdDirectPrivate(E,\"reader\"),\"readRequests\")\?.isNotEmpty()){@readableStreamFulfillReadRequest(E,d,!1),@readableStreamDefaultControllerCallPullIfNeeded(_);return}try{let D=1;if(@getByIdDirectPrivate(_,\"strategy\").size!==@undefined)D=@getByIdDirectPrivate(_,\"strategy\").size(d);@enqueueValueWithSize(@getByIdDirectPrivate(_,\"queue\"),d,D)}catch(D){throw @readableStreamDefaultControllerError(_,D),D}@readableStreamDefaultControllerCallPullIfNeeded(_)})\n"; // readableStreamDefaultReaderRead const JSC::ConstructAbility s_readableStreamInternalsReadableStreamDefaultReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1828,7 +1828,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamIntoArrayCodeC const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamIntoArrayCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsReadableStreamIntoArrayCodeLength = 247; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamIntoArrayCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamIntoArrayCode = "(function (f){\"use strict\";var b=f.getReader(),g=b.readMany();async function j(p){if(p.done)return[];var q=p.value||[];while(!0){var _=await b.read();if(_.done)break;q=q.concat(_.value)}return q}if(g&&@isPromise(g))return g.@then(j);return j(g)})\n"; +const char* const s_readableStreamInternalsReadableStreamIntoArrayCode = "(function (f){\"use strict\";var p=f.getReader(),g=p.readMany();async function b(_){if(_.done)return[];var j=_.value||[];while(!0){var q=await p.read();if(q.done)break;j=j.concat(q.value)}return j}if(g&&@isPromise(g))return g.@then(b);return b(g)})\n"; // readableStreamIntoText const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoTextCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1852,7 +1852,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamToTextDirectCo const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamToTextDirectCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsReadableStreamToTextDirectCodeLength = 278; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamToTextDirectCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamToTextDirectCode = "(async function (f,h){\"use strict\";const j=@initializeTextStream.@call(f,h,@undefined);var k=f.getReader();while(@getByIdDirectPrivate(f,\"state\")===@streamReadable){var p=await k.read();if(p.done)break}try{k.releaseLock()}catch(_){}return k=@undefined,f=@undefined,j.@promise})\n"; +const char* const s_readableStreamInternalsReadableStreamToTextDirectCode = "(async function (_,f){\"use strict\";const h=@initializeTextStream.@call(_,f,@undefined);var j=_.getReader();while(@getByIdDirectPrivate(_,\"state\")===@streamReadable){var k=await j.read();if(k.done)break}try{j.releaseLock()}catch(p){}return j=@undefined,_=@undefined,h.@promise})\n"; // readableStreamToArrayDirect const JSC::ConstructAbility s_readableStreamInternalsReadableStreamToArrayDirectCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1868,7 +1868,7 @@ const JSC::ConstructorKind s_readableStreamInternalsReadableStreamDefineLazyIter const JSC::ImplementationVisibility s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeLength = 516; static const JSC::Intrinsic s_readableStreamInternalsReadableStreamDefineLazyIteratorsCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInternalsReadableStreamDefineLazyIteratorsCode = "(function (g){\"use strict\";var h=globalThis.Symbol.asyncIterator,j=async function*z(x,B){var D=x.getReader(),F;try{while(!0){var G,k;const i=D.readMany();if(@isPromise(i))({done:G,value:k}=await i);else({done:G,value:k}=i);if(G)return;yield*k}}catch(i){F=i}finally{if(D.releaseLock(),!B)x.cancel(F);if(F)throw F}},w=function z(){return j(this,!1)},q=function z({preventCancel:x=!1}={preventCancel:!1}){return j(this,x)};return @Object.@defineProperty(g,h,{value:w}),@Object.@defineProperty(g,\"values\",{value:q}),g})\n"; +const char* const s_readableStreamInternalsReadableStreamDefineLazyIteratorsCode = "(function (k){\"use strict\";var z=globalThis.Symbol.asyncIterator,D=async function*B(G,x){var i=G.getReader(),w;try{while(!0){var q,h;const j=i.readMany();if(@isPromise(j))({done:q,value:h}=await j);else({done:q,value:h}=j);if(q)return;yield*h}}catch(j){w=j}finally{if(i.releaseLock(),!x)G.cancel(w);if(w)throw w}},F=function B(){return D(this,!1)},g=function B({preventCancel:G=!1}={preventCancel:!1}){return D(this,G)};return @Object.@defineProperty(k,z,{value:F}),@Object.@defineProperty(k,\"values\",{value:g}),k})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ @@ -1894,7 +1894,7 @@ const JSC::ConstructorKind s_transformStreamDefaultControllerDesiredSizeCodeCons const JSC::ImplementationVisibility s_transformStreamDefaultControllerDesiredSizeCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_transformStreamDefaultControllerDesiredSizeCodeLength = 339; static const JSC::Intrinsic s_transformStreamDefaultControllerDesiredSizeCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_transformStreamDefaultControllerDesiredSizeCode = "(function (){\"use strict\";if(!@isTransformStreamDefaultController(this))throw @makeThisTypeError(\"TransformStreamDefaultController\",\"enqueue\");const _=@getByIdDirectPrivate(this,\"stream\"),u=@getByIdDirectPrivate(_,\"readable\"),i=@getByIdDirectPrivate(u,\"readableStreamController\");return @readableStreamDefaultControllerGetDesiredSize(i)})\n"; +const char* const s_transformStreamDefaultControllerDesiredSizeCode = "(function (){\"use strict\";if(!@isTransformStreamDefaultController(this))throw @makeThisTypeError(\"TransformStreamDefaultController\",\"enqueue\");const _=@getByIdDirectPrivate(this,\"stream\"),i=@getByIdDirectPrivate(_,\"readable\"),u=@getByIdDirectPrivate(i,\"readableStreamController\");return @readableStreamDefaultControllerGetDesiredSize(u)})\n"; // enqueue const JSC::ConstructAbility s_transformStreamDefaultControllerEnqueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -1986,7 +1986,7 @@ const JSC::ConstructorKind s_jsBufferConstructorFromCodeConstructorKind = JSC::C const JSC::ImplementationVisibility s_jsBufferConstructorFromCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_jsBufferConstructorFromCodeLength = 1107; static const JSC::Intrinsic s_jsBufferConstructorFromCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_jsBufferConstructorFromCode = "(function (n){\"use strict\";if(@isUndefinedOrNull(n))@throwTypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.\");if(typeof n===\"string\"||typeof n===\"object\"&&(@isTypedArrayView(n)||n instanceof @ArrayBuffer||n instanceof SharedArrayBuffer||n instanceof String))switch(@argumentCount()){case 1:return new @Buffer(n);case 2:return new @Buffer(n,@argument(1));default:return new @Buffer(n,@argument(1),@argument(2))}var d=@toObject(n,\"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\");if(!@isJSArray(d)){const f=@tryGetByIdWithWellKnownSymbol(n,\"toPrimitive\");if(f){const u=f.@call(n,\"string\");if(typeof u===\"string\")switch(@argumentCount()){case 1:return new @Buffer(u);case 2:return new @Buffer(u,@argument(1));default:return new @Buffer(u,@argument(1),@argument(2))}}if(!(\"length\"in d)||@isCallable(d))@throwTypeError(\"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\")}return new @Buffer(@Uint8Array.from(d).buffer)})\n"; +const char* const s_jsBufferConstructorFromCode = "(function (n){\"use strict\";if(@isUndefinedOrNull(n))@throwTypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.\");if(typeof n===\"string\"||typeof n===\"object\"&&(@isTypedArrayView(n)||n instanceof @ArrayBuffer||n instanceof SharedArrayBuffer||n instanceof String))switch(@argumentCount()){case 1:return new @Buffer(n);case 2:return new @Buffer(n,@argument(1));default:return new @Buffer(n,@argument(1),@argument(2))}var f=@toObject(n,\"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\");if(!@isJSArray(f)){const d=@tryGetByIdWithWellKnownSymbol(n,\"toPrimitive\");if(d){const u=d.@call(n,\"string\");if(typeof u===\"string\")switch(@argumentCount()){case 1:return new @Buffer(u);case 2:return new @Buffer(u,@argument(1));default:return new @Buffer(u,@argument(1),@argument(2))}}if(!(\"length\"in f)||@isCallable(f))@throwTypeError(\"The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object.\")}return new @Buffer(@Uint8Array.from(f).buffer)})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ @@ -2020,7 +2020,7 @@ const JSC::ConstructorKind s_readableStreamDefaultReaderReadManyCodeConstructorK const JSC::ImplementationVisibility s_readableStreamDefaultReaderReadManyCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamDefaultReaderReadManyCodeLength = 2598; static const JSC::Intrinsic s_readableStreamDefaultReaderReadManyCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamDefaultReaderReadManyCode = "(function (){\"use strict\";if(!@isReadableStreamDefaultReader(this))@throwTypeError(\"ReadableStreamDefaultReader.readMany() should not be called directly\");const I=@getByIdDirectPrivate(this,\"ownerReadableStream\");if(!I)@throwTypeError(\"readMany() called on a reader owned by no readable stream\");const E=@getByIdDirectPrivate(I,\"state\");if(@putByIdDirectPrivate(I,\"disturbed\",!0),E===@streamClosed)return{value:[],size:0,done:!0};else if(E===@streamErrored)throw @getByIdDirectPrivate(I,\"storedError\");var H=@getByIdDirectPrivate(I,\"readableStreamController\"),F=@getByIdDirectPrivate(H,\"queue\");if(!F)return H.@pull(H).@then(function({done:Q,value:B}){return Q\?{done:!0,value:[],size:0}:{value:[B],size:1,done:!1}});const G=F.content;var _=F.size,D=G.toArray(!1),J=D.length;if(J>0){var K=@newArrayWithSize(J);if(@isReadableByteStreamController(H)){{const Q=D[0];if(!(@ArrayBuffer.@isView(Q)||Q instanceof @ArrayBuffer))@putByValDirect(K,0,new @Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength));else @putByValDirect(K,0,Q)}for(var d=1;d<J;d++){const Q=D[d];if(!(@ArrayBuffer.@isView(Q)||Q instanceof @ArrayBuffer))@putByValDirect(K,d,new @Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength));else @putByValDirect(K,d,Q)}}else{@putByValDirect(K,0,D[0].value);for(var d=1;d<J;d++)@putByValDirect(K,d,D[d].value)}if(@resetQueue(@getByIdDirectPrivate(H,\"queue\")),@getByIdDirectPrivate(H,\"closeRequested\"))@readableStreamClose(@getByIdDirectPrivate(H,\"controlledReadableStream\"));else if(@isReadableStreamDefaultController(H))@readableStreamDefaultControllerCallPullIfNeeded(H);else if(@isReadableByteStreamController(H))@readableByteStreamControllerCallPullIfNeeded(H);return{value:K,size:_,done:!1}}var j=(Q)=>{if(Q.done)return{value:[],size:0,done:!0};var B=@getByIdDirectPrivate(I,\"readableStreamController\"),k=@getByIdDirectPrivate(B,\"queue\"),S=[Q.value].concat(k.content.toArray(!1)),T=S.length;if(@isReadableByteStreamController(B))for(var w=0;w<T;w++){const U=S[w];if(!(@ArrayBuffer.@isView(U)||U instanceof @ArrayBuffer)){const{buffer:W,byteOffset:A,byteLength:C}=U;@putByValDirect(S,w,new @Uint8Array(W,A,C))}}else for(var w=1;w<T;w++)@putByValDirect(S,w,S[w].value);var x=k.size;if(@resetQueue(k),@getByIdDirectPrivate(B,\"closeRequested\"))@readableStreamClose(@getByIdDirectPrivate(B,\"controlledReadableStream\"));else if(@isReadableStreamDefaultController(B))@readableStreamDefaultControllerCallPullIfNeeded(B);else if(@isReadableByteStreamController(B))@readableByteStreamControllerCallPullIfNeeded(B);return{value:S,size:x,done:!1}},N=H.@pull(H);if(N&&@isPromise(N))return N.@then(j);return j(N)})\n"; +const char* const s_readableStreamDefaultReaderReadManyCode = "(function (){\"use strict\";if(!@isReadableStreamDefaultReader(this))@throwTypeError(\"ReadableStreamDefaultReader.readMany() should not be called directly\");const T=@getByIdDirectPrivate(this,\"ownerReadableStream\");if(!T)@throwTypeError(\"readMany() called on a reader owned by no readable stream\");const C=@getByIdDirectPrivate(T,\"state\");if(@putByIdDirectPrivate(T,\"disturbed\",!0),C===@streamClosed)return{value:[],size:0,done:!0};else if(C===@streamErrored)throw @getByIdDirectPrivate(T,\"storedError\");var H=@getByIdDirectPrivate(T,\"readableStreamController\"),E=@getByIdDirectPrivate(H,\"queue\");if(!E)return H.@pull(H).@then(function({done:Q,value:w}){return Q\?{done:!0,value:[],size:0}:{value:[w],size:1,done:!1}});const F=E.content;var B=E.size,_=F.toArray(!1),I=_.length;if(I>0){var k=@newArrayWithSize(I);if(@isReadableByteStreamController(H)){{const Q=_[0];if(!(@ArrayBuffer.@isView(Q)||Q instanceof @ArrayBuffer))@putByValDirect(k,0,new @Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength));else @putByValDirect(k,0,Q)}for(var N=1;N<I;N++){const Q=_[N];if(!(@ArrayBuffer.@isView(Q)||Q instanceof @ArrayBuffer))@putByValDirect(k,N,new @Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength));else @putByValDirect(k,N,Q)}}else{@putByValDirect(k,0,_[0].value);for(var N=1;N<I;N++)@putByValDirect(k,N,_[N].value)}if(@resetQueue(@getByIdDirectPrivate(H,\"queue\")),@getByIdDirectPrivate(H,\"closeRequested\"))@readableStreamClose(@getByIdDirectPrivate(H,\"controlledReadableStream\"));else if(@isReadableStreamDefaultController(H))@readableStreamDefaultControllerCallPullIfNeeded(H);else if(@isReadableByteStreamController(H))@readableByteStreamControllerCallPullIfNeeded(H);return{value:k,size:B,done:!1}}var U=(Q)=>{if(Q.done)return{value:[],size:0,done:!0};var w=@getByIdDirectPrivate(T,\"readableStreamController\"),d=@getByIdDirectPrivate(w,\"queue\"),J=[Q.value].concat(d.content.toArray(!1)),x=J.length;if(@isReadableByteStreamController(w))for(var K=0;K<x;K++){const A=J[K];if(!(@ArrayBuffer.@isView(A)||A instanceof @ArrayBuffer)){const{buffer:S,byteOffset:D,byteLength:G}=A;@putByValDirect(J,K,new @Uint8Array(S,D,G))}}else for(var K=1;K<x;K++)@putByValDirect(J,K,J[K].value);var j=d.size;if(@resetQueue(d),@getByIdDirectPrivate(w,\"closeRequested\"))@readableStreamClose(@getByIdDirectPrivate(w,\"controlledReadableStream\"));else if(@isReadableStreamDefaultController(w))@readableStreamDefaultControllerCallPullIfNeeded(w);else if(@isReadableByteStreamController(w))@readableByteStreamControllerCallPullIfNeeded(w);return{value:J,size:j,done:!1}},W=H.@pull(H);if(W&&@isPromise(W))return W.@then(U);return U(W)})\n"; // read const JSC::ConstructAbility s_readableStreamDefaultReaderReadCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2102,7 +2102,7 @@ const JSC::ConstructorKind s_streamInternalsPromiseInvokeOrNoopCodeConstructorKi const JSC::ImplementationVisibility s_streamInternalsPromiseInvokeOrNoopCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_streamInternalsPromiseInvokeOrNoopCodeLength = 116; static const JSC::Intrinsic s_streamInternalsPromiseInvokeOrNoopCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_streamInternalsPromiseInvokeOrNoopCode = "(function (n,l,d){\"use strict\";try{return @promiseInvokeOrNoopNoCatch(n,l,d)}catch(m){return @Promise.@reject(m)}})\n"; +const char* const s_streamInternalsPromiseInvokeOrNoopCode = "(function (n,d,l){\"use strict\";try{return @promiseInvokeOrNoopNoCatch(n,d,l)}catch(m){return @Promise.@reject(m)}})\n"; // promiseInvokeOrFallbackOrNoop const JSC::ConstructAbility s_streamInternalsPromiseInvokeOrFallbackOrNoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2118,7 +2118,7 @@ const JSC::ConstructorKind s_streamInternalsValidateAndNormalizeQueuingStrategyC const JSC::ImplementationVisibility s_streamInternalsValidateAndNormalizeQueuingStrategyCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_streamInternalsValidateAndNormalizeQueuingStrategyCodeLength = 263; static const JSC::Intrinsic s_streamInternalsValidateAndNormalizeQueuingStrategyCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_streamInternalsValidateAndNormalizeQueuingStrategyCode = "(function (d,l){\"use strict\";if(d!==@undefined&&typeof d!==\"function\")@throwTypeError(\"size parameter must be a function\");const f=@toNumber(l);if(@isNaN(f)||f<0)@throwRangeError(\"highWaterMark value is negative or not a number\");return{size:d,highWaterMark:f}})\n"; +const char* const s_streamInternalsValidateAndNormalizeQueuingStrategyCode = "(function (d,f){\"use strict\";if(d!==@undefined&&typeof d!==\"function\")@throwTypeError(\"size parameter must be a function\");const l=@toNumber(f);if(@isNaN(l)||l<0)@throwRangeError(\"highWaterMark value is negative or not a number\");return{size:d,highWaterMark:l}})\n"; // createFIFO const JSC::ConstructAbility s_streamInternalsCreateFIFOCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2126,7 +2126,7 @@ const JSC::ConstructorKind s_streamInternalsCreateFIFOCodeConstructorKind = JSC: const JSC::ImplementationVisibility s_streamInternalsCreateFIFOCodeImplementationVisibility = JSC::ImplementationVisibility::Private; const int s_streamInternalsCreateFIFOCodeLength = 1472; static const JSC::Intrinsic s_streamInternalsCreateFIFOCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_streamInternalsCreateFIFOCode = "(function (){\"use strict\";var b=@Array.prototype.slice;class k{constructor(){this._head=0,this._tail=0,this._capacityMask=3,this._list=@newArrayWithSize(4)}_head;_tail;_capacityMask;_list;size(){if(this._head===this._tail)return 0;if(this._head<this._tail)return this._tail-this._head;else return this._capacityMask+1-(this._head-this._tail)}isEmpty(){return this.size()==0}isNotEmpty(){return this.size()>0}shift(){var{_head:z,_tail:v,_list:g,_capacityMask:w}=this;if(z===v)return @undefined;var A=g[z];if(@putByValDirect(g,z,@undefined),z=this._head=z+1&w,z<2&&v>1e4&&v<=g.length>>>2)this._shrinkArray();return A}peek(){if(this._head===this._tail)return @undefined;return this._list[this._head]}push(z){var v=this._tail;if(@putByValDirect(this._list,v,z),this._tail=v+1&this._capacityMask,this._tail===this._head)this._growArray()}toArray(z){var v=this._list,g=@toLength(v.length);if(z||this._head>this._tail){var w=@toLength(this._head),A=@toLength(this._tail),B=@toLength(g-w+A),E=@newArrayWithSize(B),x=0;for(var F=w;F<g;F++)@putByValDirect(E,x++,v[F]);for(var F=0;F<A;F++)@putByValDirect(E,x++,v[F]);return E}else return b.@call(v,this._head,this._tail)}clear(){this._head=0,this._tail=0,this._list.fill(@undefined)}_growArray(){if(this._head)this._list=this.toArray(!0),this._head=0;this._tail=@toLength(this._list.length),this._list.length<<=1,this._capacityMask=this._capacityMask<<1|1}shrinkArray(){this._list.length>>>=1,this._capacityMask>>>=1}}return new k})\n"; +const char* const s_streamInternalsCreateFIFOCode = "(function (){\"use strict\";var b=@Array.prototype.slice;class g{constructor(){this._head=0,this._tail=0,this._capacityMask=3,this._list=@newArrayWithSize(4)}_head;_tail;_capacityMask;_list;size(){if(this._head===this._tail)return 0;if(this._head<this._tail)return this._tail-this._head;else return this._capacityMask+1-(this._head-this._tail)}isEmpty(){return this.size()==0}isNotEmpty(){return this.size()>0}shift(){var{_head:w,_tail:x,_list:z,_capacityMask:k}=this;if(w===x)return @undefined;var A=z[w];if(@putByValDirect(z,w,@undefined),w=this._head=w+1&k,w<2&&x>1e4&&x<=z.length>>>2)this._shrinkArray();return A}peek(){if(this._head===this._tail)return @undefined;return this._list[this._head]}push(w){var x=this._tail;if(@putByValDirect(this._list,x,w),this._tail=x+1&this._capacityMask,this._tail===this._head)this._growArray()}toArray(w){var x=this._list,z=@toLength(x.length);if(w||this._head>this._tail){var k=@toLength(this._head),A=@toLength(this._tail),B=@toLength(z-k+A),E=@newArrayWithSize(B),v=0;for(var F=k;F<z;F++)@putByValDirect(E,v++,x[F]);for(var F=0;F<A;F++)@putByValDirect(E,v++,x[F]);return E}else return b.@call(x,this._head,this._tail)}clear(){this._head=0,this._tail=0,this._list.fill(@undefined)}_growArray(){if(this._head)this._list=this.toArray(!0),this._head=0;this._tail=@toLength(this._list.length),this._list.length<<=1,this._capacityMask=this._capacityMask<<1|1}shrinkArray(){this._list.length>>>=1,this._capacityMask>>>=1}}return new g})\n"; // newQueue const JSC::ConstructAbility s_streamInternalsNewQueueCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2240,7 +2240,7 @@ const JSC::ConstructorKind s_importMetaObjectInternalRequireCodeConstructorKind const JSC::ImplementationVisibility s_importMetaObjectInternalRequireCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_importMetaObjectInternalRequireCodeLength = 747; static const JSC::Intrinsic s_importMetaObjectInternalRequireCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_importMetaObjectInternalRequireCode = "(function (_){\"use strict\";var b=@requireMap.@get(_);const g=_.substring(_.length-5);if(b)return b.exports;if(g===\".json\"){var j=globalThis[Symbol.for(\"_fs\")]||=@Bun.fs(),k=JSON.parse(j.readFileSync(_,\"utf8\"));return @requireMap.@set(_,@createCommonJSModule(_,k,!0)),k}else if(g===\".node\"){const q=@createCommonJSModule(_,{},!0);return process.dlopen(q,_),@requireMap.@set(_,q),q.exports}else if(g===\".toml\"){var j=globalThis[Symbol.for(\"_fs\")]||=@Bun.fs(),k=@Bun.TOML.parse(j.readFileSync(_,\"utf8\"));return @requireMap.@set(_,@createCommonJSModule(_,k,!0)),k}else{var k=@requireESM(_);const v=@requireMap.@get(_);if(v)return v.exports;var n=k\?.default;if(n\?.[@commonJSSymbol]===0)k=n;return @requireMap.@set(_,@createCommonJSModule(_,k,!0)),k}})\n"; +const char* const s_importMetaObjectInternalRequireCode = "(function (b){\"use strict\";var g=@requireMap.@get(b);const j=b.substring(b.length-5);if(g)return g.exports;if(j===\".json\"){var k=globalThis[Symbol.for(\"_fs\")]||=@Bun.fs(),q=JSON.parse(k.readFileSync(b,\"utf8\"));return @requireMap.@set(b,@createCommonJSModule(b,q,!0)),q}else if(j===\".node\"){const n=@createCommonJSModule(b,{},!0);return process.dlopen(n,b),@requireMap.@set(b,n),n.exports}else if(j===\".toml\"){var k=globalThis[Symbol.for(\"_fs\")]||=@Bun.fs(),q=@Bun.TOML.parse(k.readFileSync(b,\"utf8\"));return @requireMap.@set(b,@createCommonJSModule(b,q,!0)),q}else{var q=@requireESM(b);const v=@requireMap.@get(b);if(v)return v.exports;var _=q\?.default;if(_\?.[@commonJSSymbol]===0)q=_;return @requireMap.@set(b,@createCommonJSModule(b,q,!0)),q}})\n"; // createRequireCache const JSC::ConstructAbility s_importMetaObjectCreateRequireCacheCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2248,7 +2248,7 @@ const JSC::ConstructorKind s_importMetaObjectCreateRequireCacheCodeConstructorKi const JSC::ImplementationVisibility s_importMetaObjectCreateRequireCacheCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_importMetaObjectCreateRequireCacheCodeLength = 854; static const JSC::Intrinsic s_importMetaObjectCreateRequireCacheCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_importMetaObjectCreateRequireCacheCode = "(function (){\"use strict\";var _=new Map,t={};return new Proxy(t,{get(L,f){const h=@requireMap.@get(f);if(h)return h;const u=@Loader.registry.@get(f);if(u\?.evaluated){const b=@Loader.getModuleNamespaceObject(u.module),c=b[@commonJSSymbol]===0||b.default\?.[@commonJSSymbol]\?b.default:b,g=@createCommonJSModule(f,c,!0);return @requireMap.@set(f,g),g}return t[f]},set(L,f,h){return @requireMap.@set(f,h),!0},has(L,f){return @requireMap.@has(f)||@Loader.registry.@has(f)},deleteProperty(L,f){return _.@delete(f),@requireMap.@delete(f),@Loader.registry.@delete(f),!0},ownKeys(L){var f=[...@requireMap.@keys()];const h=[...@Loader.registry.@keys()];for(let u of h)if(!f.includes(u))@arrayPush(f,u);return f},getPrototypeOf(L){return null},getOwnPropertyDescriptor(L,f){if(@requireMap.@has(f)||@Loader.registry.@has(f))return{configurable:!0,enumerable:!0}}})})\n"; +const char* const s_importMetaObjectCreateRequireCacheCode = "(function (){\"use strict\";var f=new Map,u={};return new Proxy(u,{get(c,L){const h=@requireMap.@get(L);if(h)return h;const g=@Loader.registry.@get(L);if(g\?.evaluated){const _=@Loader.getModuleNamespaceObject(g.module),b=_[@commonJSSymbol]===0||_.default\?.[@commonJSSymbol]\?_.default:_,t=@createCommonJSModule(L,b,!0);return @requireMap.@set(L,t),t}return u[L]},set(c,L,h){return @requireMap.@set(L,h),!0},has(c,L){return @requireMap.@has(L)||@Loader.registry.@has(L)},deleteProperty(c,L){return f.@delete(L),@requireMap.@delete(L),@Loader.registry.@delete(L),!0},ownKeys(c){var L=[...@requireMap.@keys()];const h=[...@Loader.registry.@keys()];for(let g of h)if(!L.includes(g))@arrayPush(L,g);return L},getPrototypeOf(c){return null},getOwnPropertyDescriptor(c,L){if(@requireMap.@has(L)||@Loader.registry.@has(L))return{configurable:!0,enumerable:!0}}})})\n"; // require const JSC::ConstructAbility s_importMetaObjectRequireCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2432,7 +2432,7 @@ const JSC::ConstructorKind s_readableStreamInitializeReadableStreamCodeConstruct const JSC::ImplementationVisibility s_readableStreamInitializeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamInitializeReadableStreamCodeLength = 2065; static const JSC::Intrinsic s_readableStreamInitializeReadableStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamInitializeReadableStreamCode = "(function (_,f){\"use strict\";if(_===@undefined)_={@bunNativeType:0,@bunNativePtr:0,@lazy:!1};if(f===@undefined)f={};if(!@isObject(_))@throwTypeError(\"ReadableStream constructor takes an object as first argument\");if(f!==@undefined&&!@isObject(f))@throwTypeError(\"ReadableStream constructor takes an object as second argument, if any\");@putByIdDirectPrivate(this,\"state\",@streamReadable),@putByIdDirectPrivate(this,\"reader\",@undefined),@putByIdDirectPrivate(this,\"storedError\",@undefined),@putByIdDirectPrivate(this,\"disturbed\",!1),@putByIdDirectPrivate(this,\"readableStreamController\",null),@putByIdDirectPrivate(this,\"bunNativeType\",@getByIdDirectPrivate(_,\"bunNativeType\")\?\?0),@putByIdDirectPrivate(this,\"bunNativePtr\",@getByIdDirectPrivate(_,\"bunNativePtr\")\?\?0);const m=_.type===\"direct\",v=!!_.@lazy,B=m||v;if(@getByIdDirectPrivate(_,\"pull\")!==@undefined&&!B){const I=@getByIdDirectPrivate(f,\"size\"),b=@getByIdDirectPrivate(f,\"highWaterMark\");return @putByIdDirectPrivate(this,\"highWaterMark\",b),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@setupReadableStreamDefaultController(this,_,I,b!==@undefined\?b:1,@getByIdDirectPrivate(_,\"start\"),@getByIdDirectPrivate(_,\"pull\"),@getByIdDirectPrivate(_,\"cancel\")),this}if(m)@putByIdDirectPrivate(this,\"underlyingSource\",_),@putByIdDirectPrivate(this,\"highWaterMark\",@getByIdDirectPrivate(f,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",()=>@createReadableStreamController(this,_,f));else if(B){const I=_.autoAllocateChunkSize;@putByIdDirectPrivate(this,\"highWaterMark\",@undefined),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"highWaterMark\",I||@getByIdDirectPrivate(f,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",()=>{const b=@lazyLoadStream(this,I);if(b)@createReadableStreamController(this,b,f)})}else @putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"highWaterMark\",@getByIdDirectPrivate(f,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",@undefined),@createReadableStreamController(this,_,f);return this})\n"; +const char* const s_readableStreamInitializeReadableStreamCode = "(function (f,B){\"use strict\";if(f===@undefined)f={@bunNativeType:0,@bunNativePtr:0,@lazy:!1};if(B===@undefined)B={};if(!@isObject(f))@throwTypeError(\"ReadableStream constructor takes an object as first argument\");if(B!==@undefined&&!@isObject(B))@throwTypeError(\"ReadableStream constructor takes an object as second argument, if any\");@putByIdDirectPrivate(this,\"state\",@streamReadable),@putByIdDirectPrivate(this,\"reader\",@undefined),@putByIdDirectPrivate(this,\"storedError\",@undefined),@putByIdDirectPrivate(this,\"disturbed\",!1),@putByIdDirectPrivate(this,\"readableStreamController\",null),@putByIdDirectPrivate(this,\"bunNativeType\",@getByIdDirectPrivate(f,\"bunNativeType\")\?\?0),@putByIdDirectPrivate(this,\"bunNativePtr\",@getByIdDirectPrivate(f,\"bunNativePtr\")\?\?0);const b=f.type===\"direct\",m=!!f.@lazy,v=b||m;if(@getByIdDirectPrivate(f,\"pull\")!==@undefined&&!v){const I=@getByIdDirectPrivate(B,\"size\"),_=@getByIdDirectPrivate(B,\"highWaterMark\");return @putByIdDirectPrivate(this,\"highWaterMark\",_),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@setupReadableStreamDefaultController(this,f,I,_!==@undefined\?_:1,@getByIdDirectPrivate(f,\"start\"),@getByIdDirectPrivate(f,\"pull\"),@getByIdDirectPrivate(f,\"cancel\")),this}if(b)@putByIdDirectPrivate(this,\"underlyingSource\",f),@putByIdDirectPrivate(this,\"highWaterMark\",@getByIdDirectPrivate(B,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",()=>@createReadableStreamController(this,f,B));else if(v){const I=f.autoAllocateChunkSize;@putByIdDirectPrivate(this,\"highWaterMark\",@undefined),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"highWaterMark\",I||@getByIdDirectPrivate(B,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",()=>{const _=@lazyLoadStream(this,I);if(_)@createReadableStreamController(this,_,B)})}else @putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"highWaterMark\",@getByIdDirectPrivate(B,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",@undefined),@createReadableStreamController(this,f,B);return this})\n"; // readableStreamToArray const JSC::ConstructAbility s_readableStreamReadableStreamToArrayCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2448,7 +2448,7 @@ const JSC::ConstructorKind s_readableStreamReadableStreamToTextCodeConstructorKi const JSC::ImplementationVisibility s_readableStreamReadableStreamToTextCodeImplementationVisibility = JSC::ImplementationVisibility::Private; const int s_readableStreamReadableStreamToTextCodeLength = 171; static const JSC::Intrinsic s_readableStreamReadableStreamToTextCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamReadableStreamToTextCode = "(function (p){\"use strict\";var _=@getByIdDirectPrivate(p,\"underlyingSource\");if(_!==@undefined)return @readableStreamToTextDirect(p,_);return @readableStreamIntoText(p)})\n"; +const char* const s_readableStreamReadableStreamToTextCode = "(function (_){\"use strict\";var p=@getByIdDirectPrivate(_,\"underlyingSource\");if(p!==@undefined)return @readableStreamToTextDirect(_,p);return @readableStreamIntoText(_)})\n"; // readableStreamToArrayBuffer const JSC::ConstructAbility s_readableStreamReadableStreamToArrayBufferCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2456,7 +2456,7 @@ const JSC::ConstructorKind s_readableStreamReadableStreamToArrayBufferCodeConstr const JSC::ImplementationVisibility s_readableStreamReadableStreamToArrayBufferCodeImplementationVisibility = JSC::ImplementationVisibility::Private; const int s_readableStreamReadableStreamToArrayBufferCodeLength = 270; static const JSC::Intrinsic s_readableStreamReadableStreamToArrayBufferCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamReadableStreamToArrayBufferCode = "(function (_){\"use strict\";var b=@getByIdDirectPrivate(_,\"underlyingSource\");if(b!==@undefined)return @readableStreamToArrayBufferDirect(_,b);var p=@Bun.readableStreamToArray(_);if(@isPromise(p))return p.then(@Bun.concatArrayBuffers);return @Bun.concatArrayBuffers(p)})\n"; +const char* const s_readableStreamReadableStreamToArrayBufferCode = "(function (_){\"use strict\";var p=@getByIdDirectPrivate(_,\"underlyingSource\");if(p!==@undefined)return @readableStreamToArrayBufferDirect(_,p);var b=@Bun.readableStreamToArray(_);if(@isPromise(b))return b.then(@Bun.concatArrayBuffers);return @Bun.concatArrayBuffers(b)})\n"; // readableStreamToJSON const JSC::ConstructAbility s_readableStreamReadableStreamToJSONCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2480,7 +2480,7 @@ const JSC::ConstructorKind s_readableStreamConsumeReadableStreamCodeConstructorK const JSC::ImplementationVisibility s_readableStreamConsumeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private; const int s_readableStreamConsumeReadableStreamCodeLength = 1603; static const JSC::Intrinsic s_readableStreamConsumeReadableStreamCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamConsumeReadableStreamCode = "(function (_,H,F){\"use strict\";const j=globalThis.Symbol.for(\"Bun.consumeReadableStreamPrototype\");var A=globalThis[j];if(!A)A=globalThis[j]=[];var G=A[H];if(G===@undefined){var[I,J,K,k,L,N]=globalThis[globalThis.Symbol.for(\"Bun.lazy\")](H);G=class B{handleError;handleClosed;processResult;constructor(D,w){this.#_=w,this.#F=D,this.#$=!1,this.handleError=this._handleError.bind(this),this.handleClosed=this._handleClosed.bind(this),this.processResult=this._processResult.bind(this),D.closed.then(this.handleClosed,this.handleError)}_handleClosed(){if(this.#$)return;this.#$=!0;var D=this.#_;this.#_=0,k(D),N(D)}_handleError(D){if(this.#$)return;this.#$=!0;var w=this.#_;this.#_=0,J(w,D),N(w)}#_;#$=!1;#F;_handleReadMany({value:D,done:w,size:x}){if(w){this.handleClosed();return}if(this.#$)return;K(this.#_,D,w,x)}read(){if(!this.#_)return @throwTypeError(\"ReadableStreamSink is already closed\");return this.processResult(this.#F.read())}_processResult(D){if(D&&@isPromise(D)){if(@getPromiseInternalField(D,@promiseFieldFlags)&@promiseStateFulfilled){const x=@getPromiseInternalField(D,@promiseFieldReactionsOrResult);if(x)D=x}}if(D&&@isPromise(D))return D.then(this.processResult,this.handleError),null;if(D.done)return this.handleClosed(),0;else if(D.value)return D.value;else return-1}readMany(){if(!this.#_)return @throwTypeError(\"ReadableStreamSink is already closed\");return this.processResult(this.#F.readMany())}};const q=H+1;if(A.length<q)A.length=q;@putByValDirect(A,H,G)}if(@isReadableStreamLocked(F))@throwTypeError(\"Cannot start reading from a locked stream\");return new G(F.getReader(),_)})\n"; +const char* const s_readableStreamConsumeReadableStreamCode = "(function (q,w,x){\"use strict\";const A=globalThis.Symbol.for(\"Bun.consumeReadableStreamPrototype\");var F=globalThis[A];if(!F)F=globalThis[A]=[];var I=F[w];if(I===@undefined){var[j,J,K,L,G,_]=globalThis[globalThis.Symbol.for(\"Bun.lazy\")](w);I=class H{handleError;handleClosed;processResult;constructor(D,N){this.#_=N,this.#F=D,this.#$=!1,this.handleError=this._handleError.bind(this),this.handleClosed=this._handleClosed.bind(this),this.processResult=this._processResult.bind(this),D.closed.then(this.handleClosed,this.handleError)}_handleClosed(){if(this.#$)return;this.#$=!0;var D=this.#_;this.#_=0,L(D),_(D)}_handleError(D){if(this.#$)return;this.#$=!0;var N=this.#_;this.#_=0,J(N,D),_(N)}#_;#$=!1;#F;_handleReadMany({value:D,done:N,size:k}){if(N){this.handleClosed();return}if(this.#$)return;K(this.#_,D,N,k)}read(){if(!this.#_)return @throwTypeError(\"ReadableStreamSink is already closed\");return this.processResult(this.#F.read())}_processResult(D){if(D&&@isPromise(D)){if(@getPromiseInternalField(D,@promiseFieldFlags)&@promiseStateFulfilled){const k=@getPromiseInternalField(D,@promiseFieldReactionsOrResult);if(k)D=k}}if(D&&@isPromise(D))return D.then(this.processResult,this.handleError),null;if(D.done)return this.handleClosed(),0;else if(D.value)return D.value;else return-1}readMany(){if(!this.#_)return @throwTypeError(\"ReadableStreamSink is already closed\");return this.processResult(this.#F.readMany())}};const B=w+1;if(F.length<B)F.length=B;@putByValDirect(F,w,I)}if(@isReadableStreamLocked(x))@throwTypeError(\"Cannot start reading from a locked stream\");return new I(x.getReader(),q)})\n"; // createEmptyReadableStream const JSC::ConstructAbility s_readableStreamCreateEmptyReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2520,7 +2520,7 @@ const JSC::ConstructorKind s_readableStreamPipeThroughCodeConstructorKind = JSC: const JSC::ImplementationVisibility s_readableStreamPipeThroughCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableStreamPipeThroughCodeLength = 877; static const JSC::Intrinsic s_readableStreamPipeThroughCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableStreamPipeThroughCode = "(function (y,j){\"use strict\";const q=y,d=q[\"readable\"];if(!@isReadableStream(d))throw @makeTypeError(\"readable should be ReadableStream\");const c=q[\"writable\"],x=@getInternalWritableStream(c);if(!@isWritableStream(x))throw @makeTypeError(\"writable should be WritableStream\");let _=!1,u=!1,h=!1,k;if(!@isUndefinedOrNull(j)){if(!@isObject(j))throw @makeTypeError(\"options must be an object\");if(u=!!j[\"preventAbort\"],h=!!j[\"preventCancel\"],_=!!j[\"preventClose\"],k=j[\"signal\"],k!==@undefined&&!@isAbortSignal(k))throw @makeTypeError(\"options.signal must be AbortSignal\")}if(!@isReadableStream(this))throw @makeThisTypeError(\"ReadableStream\",\"pipeThrough\");if(@isReadableStreamLocked(this))throw @makeTypeError(\"ReadableStream is locked\");if(@isWritableStreamLocked(x))throw @makeTypeError(\"WritableStream is locked\");return @readableStreamPipeToWritableStream(this,x,_,u,h,k),d})\n"; +const char* const s_readableStreamPipeThroughCode = "(function (_,j){\"use strict\";const d=_,u=d[\"readable\"];if(!@isReadableStream(u))throw @makeTypeError(\"readable should be ReadableStream\");const c=d[\"writable\"],h=@getInternalWritableStream(c);if(!@isWritableStream(h))throw @makeTypeError(\"writable should be WritableStream\");let k=!1,q=!1,x=!1,y;if(!@isUndefinedOrNull(j)){if(!@isObject(j))throw @makeTypeError(\"options must be an object\");if(q=!!j[\"preventAbort\"],x=!!j[\"preventCancel\"],k=!!j[\"preventClose\"],y=j[\"signal\"],y!==@undefined&&!@isAbortSignal(y))throw @makeTypeError(\"options.signal must be AbortSignal\")}if(!@isReadableStream(this))throw @makeThisTypeError(\"ReadableStream\",\"pipeThrough\");if(@isReadableStreamLocked(this))throw @makeTypeError(\"ReadableStream is locked\");if(@isWritableStreamLocked(h))throw @makeTypeError(\"WritableStream is locked\");return @readableStreamPipeToWritableStream(this,h,k,q,x,y),u})\n"; // pipeTo const JSC::ConstructAbility s_readableStreamPipeToCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2628,7 +2628,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsPrivateInitializeReadabl const JSC::ImplementationVisibility s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeLength = 1654; static const JSC::Intrinsic s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode = "(function (_,p,v){\"use strict\";if(!@isReadableStream(_))@throwTypeError(\"ReadableByteStreamController needs a ReadableStream\");if(@getByIdDirectPrivate(_,\"readableStreamController\")!==null)@throwTypeError(\"ReadableStream already has a controller\");@putByIdDirectPrivate(this,\"controlledReadableStream\",_),@putByIdDirectPrivate(this,\"underlyingByteSource\",p),@putByIdDirectPrivate(this,\"pullAgain\",!1),@putByIdDirectPrivate(this,\"pulling\",!1),@readableByteStreamControllerClearPendingPullIntos(this),@putByIdDirectPrivate(this,\"queue\",@newQueue()),@putByIdDirectPrivate(this,\"started\",0),@putByIdDirectPrivate(this,\"closeRequested\",!1);let f=@toNumber(v);if(@isNaN(f)||f<0)@throwRangeError(\"highWaterMark value is negative or not a number\");@putByIdDirectPrivate(this,\"strategyHWM\",f);let R=p.autoAllocateChunkSize;if(R!==@undefined){if(R=@toNumber(R),R<=0||R===@Infinity||R===-@Infinity)@throwRangeError(\"autoAllocateChunkSize value is negative or equal to positive or negative infinity\")}@putByIdDirectPrivate(this,\"autoAllocateChunkSize\",R),@putByIdDirectPrivate(this,\"pendingPullIntos\",@createFIFO());const d=this;return @promiseInvokeOrNoopNoCatch(@getByIdDirectPrivate(d,\"underlyingByteSource\"),\"start\",[d]).@then(()=>{@putByIdDirectPrivate(d,\"started\",1),@assert(!@getByIdDirectPrivate(d,\"pulling\")),@assert(!@getByIdDirectPrivate(d,\"pullAgain\")),@readableByteStreamControllerCallPullIfNeeded(d)},(b)=>{if(@getByIdDirectPrivate(_,\"state\")===@streamReadable)@readableByteStreamControllerError(d,b)}),@putByIdDirectPrivate(this,\"cancel\",@readableByteStreamControllerCancel),@putByIdDirectPrivate(this,\"pull\",@readableByteStreamControllerPull),this})\n"; +const char* const s_readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCode = "(function (_,v,b){\"use strict\";if(!@isReadableStream(_))@throwTypeError(\"ReadableByteStreamController needs a ReadableStream\");if(@getByIdDirectPrivate(_,\"readableStreamController\")!==null)@throwTypeError(\"ReadableStream already has a controller\");@putByIdDirectPrivate(this,\"controlledReadableStream\",_),@putByIdDirectPrivate(this,\"underlyingByteSource\",v),@putByIdDirectPrivate(this,\"pullAgain\",!1),@putByIdDirectPrivate(this,\"pulling\",!1),@readableByteStreamControllerClearPendingPullIntos(this),@putByIdDirectPrivate(this,\"queue\",@newQueue()),@putByIdDirectPrivate(this,\"started\",0),@putByIdDirectPrivate(this,\"closeRequested\",!1);let f=@toNumber(b);if(@isNaN(f)||f<0)@throwRangeError(\"highWaterMark value is negative or not a number\");@putByIdDirectPrivate(this,\"strategyHWM\",f);let p=v.autoAllocateChunkSize;if(p!==@undefined){if(p=@toNumber(p),p<=0||p===@Infinity||p===-@Infinity)@throwRangeError(\"autoAllocateChunkSize value is negative or equal to positive or negative infinity\")}@putByIdDirectPrivate(this,\"autoAllocateChunkSize\",p),@putByIdDirectPrivate(this,\"pendingPullIntos\",@createFIFO());const R=this;return @promiseInvokeOrNoopNoCatch(@getByIdDirectPrivate(R,\"underlyingByteSource\"),\"start\",[R]).@then(()=>{@putByIdDirectPrivate(R,\"started\",1),@assert(!@getByIdDirectPrivate(R,\"pulling\")),@assert(!@getByIdDirectPrivate(R,\"pullAgain\")),@readableByteStreamControllerCallPullIfNeeded(R)},(d)=>{if(@getByIdDirectPrivate(_,\"state\")===@streamReadable)@readableByteStreamControllerError(R,d)}),@putByIdDirectPrivate(this,\"cancel\",@readableByteStreamControllerCancel),@putByIdDirectPrivate(this,\"pull\",@readableByteStreamControllerPull),this})\n"; // readableStreamByteStreamControllerStart const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamByteStreamControllerStartCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2684,7 +2684,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeLength = 316; static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerErrorCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerErrorCode = "(function (a,_){\"use strict\";@assert(@getByIdDirectPrivate(@getByIdDirectPrivate(a,\"controlledReadableStream\"),\"state\")===@streamReadable),@readableByteStreamControllerClearPendingPullIntos(a),@putByIdDirectPrivate(a,\"queue\",@newQueue()),@readableStreamError(@getByIdDirectPrivate(a,\"controlledReadableStream\"),_)})\n"; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerErrorCode = "(function (_,a){\"use strict\";@assert(@getByIdDirectPrivate(@getByIdDirectPrivate(_,\"controlledReadableStream\"),\"state\")===@streamReadable),@readableByteStreamControllerClearPendingPullIntos(_),@putByIdDirectPrivate(_,\"queue\",@newQueue()),@readableStreamError(@getByIdDirectPrivate(_,\"controlledReadableStream\"),a)})\n"; // readableByteStreamControllerClose const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCloseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2740,7 +2740,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableByteStreamInternalsReadableByteStreamControllerPullCodeLength = 1005; static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerPullCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullCode = "(function (d){\"use strict\";const h=@getByIdDirectPrivate(d,\"controlledReadableStream\");if(@assert(@readableStreamHasDefaultReader(h)),@getByIdDirectPrivate(d,\"queue\").content\?.isNotEmpty()){const P=@getByIdDirectPrivate(d,\"queue\").content.shift();@getByIdDirectPrivate(d,\"queue\").size-=P.byteLength,@readableByteStreamControllerHandleQueueDrain(d);let R;try{R=new @Uint8Array(P.buffer,P.byteOffset,P.byteLength)}catch(_){return @Promise.@reject(_)}return @createFulfilledPromise({value:R,done:!1})}if(@getByIdDirectPrivate(d,\"autoAllocateChunkSize\")!==@undefined){let P;try{P=@createUninitializedArrayBuffer(@getByIdDirectPrivate(d,\"autoAllocateChunkSize\"))}catch(_){return @Promise.@reject(_)}const R={buffer:P,byteOffset:0,byteLength:@getByIdDirectPrivate(d,\"autoAllocateChunkSize\"),bytesFilled:0,elementSize:1,ctor:@Uint8Array,readerType:\"default\"};@getByIdDirectPrivate(d,\"pendingPullIntos\").push(R)}const F=@readableStreamAddReadRequest(h);return @readableByteStreamControllerCallPullIfNeeded(d),F})\n"; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullCode = "(function (_){\"use strict\";const P=@getByIdDirectPrivate(_,\"controlledReadableStream\");if(@assert(@readableStreamHasDefaultReader(P)),@getByIdDirectPrivate(_,\"queue\").content\?.isNotEmpty()){const R=@getByIdDirectPrivate(_,\"queue\").content.shift();@getByIdDirectPrivate(_,\"queue\").size-=R.byteLength,@readableByteStreamControllerHandleQueueDrain(_);let h;try{h=new @Uint8Array(R.buffer,R.byteOffset,R.byteLength)}catch(F){return @Promise.@reject(F)}return @createFulfilledPromise({value:h,done:!1})}if(@getByIdDirectPrivate(_,\"autoAllocateChunkSize\")!==@undefined){let R;try{R=@createUninitializedArrayBuffer(@getByIdDirectPrivate(_,\"autoAllocateChunkSize\"))}catch(F){return @Promise.@reject(F)}const h={buffer:R,byteOffset:0,byteLength:@getByIdDirectPrivate(_,\"autoAllocateChunkSize\"),bytesFilled:0,elementSize:1,ctor:@Uint8Array,readerType:\"default\"};@getByIdDirectPrivate(_,\"pendingPullIntos\").push(h)}const d=@readableStreamAddReadRequest(P);return @readableByteStreamControllerCallPullIfNeeded(_),d})\n"; // readableByteStreamControllerShouldCallPull const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2748,7 +2748,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeLength = 619; static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode = "(function (u){\"use strict\";const b=@getByIdDirectPrivate(u,\"controlledReadableStream\");if(@getByIdDirectPrivate(b,\"state\")!==@streamReadable)return!1;if(@getByIdDirectPrivate(u,\"closeRequested\"))return!1;if(!(@getByIdDirectPrivate(u,\"started\")>0))return!1;const P=@getByIdDirectPrivate(b,\"reader\");if(P&&(@getByIdDirectPrivate(P,\"readRequests\")\?.isNotEmpty()||!!@getByIdDirectPrivate(P,\"bunNativePtr\")))return!0;if(@readableStreamHasBYOBReader(b)&&@getByIdDirectPrivate(@getByIdDirectPrivate(b,\"reader\"),\"readIntoRequests\")\?.isNotEmpty())return!0;if(@readableByteStreamControllerGetDesiredSize(u)>0)return!0;return!1})\n"; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerShouldCallPullCode = "(function (u){\"use strict\";const P=@getByIdDirectPrivate(u,\"controlledReadableStream\");if(@getByIdDirectPrivate(P,\"state\")!==@streamReadable)return!1;if(@getByIdDirectPrivate(u,\"closeRequested\"))return!1;if(!(@getByIdDirectPrivate(u,\"started\")>0))return!1;const b=@getByIdDirectPrivate(P,\"reader\");if(b&&(@getByIdDirectPrivate(b,\"readRequests\")\?.isNotEmpty()||!!@getByIdDirectPrivate(b,\"bunNativePtr\")))return!0;if(@readableStreamHasBYOBReader(P)&&@getByIdDirectPrivate(@getByIdDirectPrivate(P,\"reader\"),\"readIntoRequests\")\?.isNotEmpty())return!0;if(@readableByteStreamControllerGetDesiredSize(u)>0)return!0;return!1})\n"; // readableByteStreamControllerCallPullIfNeeded const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerCallPullIfNeededCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2780,7 +2780,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeLength = 1076; static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCode = "(function (i,d){\"use strict\";const _=@getByIdDirectPrivate(i,\"controlledReadableStream\");switch(@assert(!@getByIdDirectPrivate(i,\"closeRequested\")),@assert(@getByIdDirectPrivate(_,\"state\")===@streamReadable),@getByIdDirectPrivate(_,\"reader\")\?@readableStreamReaderKind(@getByIdDirectPrivate(_,\"reader\")):0){case 1:{if(!@getByIdDirectPrivate(@getByIdDirectPrivate(_,\"reader\"),\"readRequests\")\?.isNotEmpty())@readableByteStreamControllerEnqueueChunk(i,@transferBufferToCurrentRealm(d.buffer),d.byteOffset,d.byteLength);else{@assert(!@getByIdDirectPrivate(i,\"queue\").content.size());const f=d.constructor===@Uint8Array\?d:new @Uint8Array(d.buffer,d.byteOffset,d.byteLength);@readableStreamFulfillReadRequest(_,f,!1)}break}case 2:{@readableByteStreamControllerEnqueueChunk(i,@transferBufferToCurrentRealm(d.buffer),d.byteOffset,d.byteLength),@readableByteStreamControllerProcessPullDescriptors(i);break}case 3:break;default:{@assert(!@isReadableStreamLocked(_)),@readableByteStreamControllerEnqueueChunk(i,@transferBufferToCurrentRealm(d.buffer),d.byteOffset,d.byteLength);break}}})\n"; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueCode = "(function (i,d){\"use strict\";const f=@getByIdDirectPrivate(i,\"controlledReadableStream\");switch(@assert(!@getByIdDirectPrivate(i,\"closeRequested\")),@assert(@getByIdDirectPrivate(f,\"state\")===@streamReadable),@getByIdDirectPrivate(f,\"reader\")\?@readableStreamReaderKind(@getByIdDirectPrivate(f,\"reader\")):0){case 1:{if(!@getByIdDirectPrivate(@getByIdDirectPrivate(f,\"reader\"),\"readRequests\")\?.isNotEmpty())@readableByteStreamControllerEnqueueChunk(i,@transferBufferToCurrentRealm(d.buffer),d.byteOffset,d.byteLength);else{@assert(!@getByIdDirectPrivate(i,\"queue\").content.size());const _=d.constructor===@Uint8Array\?d:new @Uint8Array(d.buffer,d.byteOffset,d.byteLength);@readableStreamFulfillReadRequest(f,_,!1)}break}case 2:{@readableByteStreamControllerEnqueueChunk(i,@transferBufferToCurrentRealm(d.buffer),d.byteOffset,d.byteLength),@readableByteStreamControllerProcessPullDescriptors(i);break}case 3:break;default:{@assert(!@isReadableStreamLocked(f)),@readableByteStreamControllerEnqueueChunk(i,@transferBufferToCurrentRealm(d.buffer),d.byteOffset,d.byteLength);break}}})\n"; // readableByteStreamControllerEnqueueChunk const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2788,7 +2788,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeLength = 160; static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode = "(function (_,a,p,d){\"use strict\";@getByIdDirectPrivate(_,\"queue\").content.push({buffer:a,byteOffset:p,byteLength:d}),@getByIdDirectPrivate(_,\"queue\").size+=d})\n"; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerEnqueueChunkCode = "(function (_,a,d,p){\"use strict\";@getByIdDirectPrivate(_,\"queue\").content.push({buffer:a,byteOffset:d,byteLength:p}),@getByIdDirectPrivate(_,\"queue\").size+=p})\n"; // readableByteStreamControllerRespondWithNewView const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondWithNewViewCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2812,7 +2812,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeLength = 464; static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode = "(function (d,u){\"use strict\";let _=@getByIdDirectPrivate(d,\"pendingPullIntos\").peek(),k=@getByIdDirectPrivate(d,\"controlledReadableStream\");if(@getByIdDirectPrivate(k,\"state\")===@streamClosed){if(u!==0)@throwTypeError(\"bytesWritten is different from 0 even though stream is closed\");@readableByteStreamControllerRespondInClosedState(d,_)}else @assert(@getByIdDirectPrivate(k,\"state\")===@streamReadable),@readableByteStreamControllerRespondInReadableState(d,u,_)})\n"; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerRespondInternalCode = "(function (d,u){\"use strict\";let k=@getByIdDirectPrivate(d,\"pendingPullIntos\").peek(),_=@getByIdDirectPrivate(d,\"controlledReadableStream\");if(@getByIdDirectPrivate(_,\"state\")===@streamClosed){if(u!==0)@throwTypeError(\"bytesWritten is different from 0 even though stream is closed\");@readableByteStreamControllerRespondInClosedState(d,k)}else @assert(@getByIdDirectPrivate(_,\"state\")===@streamReadable),@readableByteStreamControllerRespondInReadableState(d,u,k)})\n"; // readableByteStreamControllerRespondInReadableState const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerRespondInReadableStateCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2844,7 +2844,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeLength = 970; static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode = "(function (_,z){\"use strict\";const q=z.bytesFilled-z.bytesFilled%z.elementSize,j=@getByIdDirectPrivate(_,\"queue\").size<z.byteLength-z.bytesFilled\?@getByIdDirectPrivate(_,\"queue\").size:z.byteLength-z.bytesFilled,v=z.bytesFilled+j,w=v-v%z.elementSize;let E=j,G=!1;if(w>q)E=w-z.bytesFilled,G=!0;while(E>0){let H=@getByIdDirectPrivate(_,\"queue\").content.peek();const k=E<H.byteLength\?E:H.byteLength,J=z.byteOffset+z.bytesFilled;if(new @Uint8Array(z.buffer).set(new @Uint8Array(H.buffer,H.byteOffset,k),J),H.byteLength===k)@getByIdDirectPrivate(_,\"queue\").content.shift();else H.byteOffset+=k,H.byteLength-=k;@getByIdDirectPrivate(_,\"queue\").size-=k,@assert(@getByIdDirectPrivate(_,\"pendingPullIntos\").isEmpty()||@getByIdDirectPrivate(_,\"pendingPullIntos\").peek()===z),@readableByteStreamControllerInvalidateBYOBRequest(_),z.bytesFilled+=k,E-=k}if(!G)@assert(@getByIdDirectPrivate(_,\"queue\").size===0),@assert(z.bytesFilled>0),@assert(z.bytesFilled<z.elementSize);return G})\n"; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerFillDescriptorFromQueueCode = "(function (q,j){\"use strict\";const k=j.bytesFilled-j.bytesFilled%j.elementSize,v=@getByIdDirectPrivate(q,\"queue\").size<j.byteLength-j.bytesFilled\?@getByIdDirectPrivate(q,\"queue\").size:j.byteLength-j.bytesFilled,w=j.bytesFilled+v,z=w-w%j.elementSize;let E=v,G=!1;if(z>k)E=z-j.bytesFilled,G=!0;while(E>0){let H=@getByIdDirectPrivate(q,\"queue\").content.peek();const J=E<H.byteLength\?E:H.byteLength,_=j.byteOffset+j.bytesFilled;if(new @Uint8Array(j.buffer).set(new @Uint8Array(H.buffer,H.byteOffset,J),_),H.byteLength===J)@getByIdDirectPrivate(q,\"queue\").content.shift();else H.byteOffset+=J,H.byteLength-=J;@getByIdDirectPrivate(q,\"queue\").size-=J,@assert(@getByIdDirectPrivate(q,\"pendingPullIntos\").isEmpty()||@getByIdDirectPrivate(q,\"pendingPullIntos\").peek()===j),@readableByteStreamControllerInvalidateBYOBRequest(q),j.bytesFilled+=J,E-=J}if(!G)@assert(@getByIdDirectPrivate(q,\"queue\").size===0),@assert(j.bytesFilled>0),@assert(j.bytesFilled<j.elementSize);return G})\n"; // readableByteStreamControllerShiftPendingDescriptor const JSC::ConstructAbility s_readableByteStreamInternalsReadableByteStreamControllerShiftPendingDescriptorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2900,7 +2900,7 @@ const JSC::ConstructorKind s_readableByteStreamInternalsReadableByteStreamContro const JSC::ImplementationVisibility s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeLength = 1255; static const JSC::Intrinsic s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCode = "(function (b,d){\"use strict\";const A=@getByIdDirectPrivate(b,\"controlledReadableStream\");let k=1;if(d.BYTES_PER_ELEMENT!==@undefined)k=d.BYTES_PER_ELEMENT;const E=d.constructor,L={buffer:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength,bytesFilled:0,elementSize:k,ctor:E,readerType:\"byob\"};var _=@getByIdDirectPrivate(b,\"pendingPullIntos\");if(_\?.isNotEmpty())return L.buffer=@transferBufferToCurrentRealm(L.buffer),_.push(L),@readableStreamAddReadIntoRequest(A);if(@getByIdDirectPrivate(A,\"state\")===@streamClosed){const R=new E(L.buffer,L.byteOffset,0);return @createFulfilledPromise({value:R,done:!0})}if(@getByIdDirectPrivate(b,\"queue\").size>0){if(@readableByteStreamControllerFillDescriptorFromQueue(b,L)){const R=@readableByteStreamControllerConvertDescriptor(L);return @readableByteStreamControllerHandleQueueDrain(b),@createFulfilledPromise({value:R,done:!1})}if(@getByIdDirectPrivate(b,\"closeRequested\")){const R=@makeTypeError(\"Closing stream has been requested\");return @readableByteStreamControllerError(b,R),@Promise.@reject(R)}}L.buffer=@transferBufferToCurrentRealm(L.buffer),@getByIdDirectPrivate(b,\"pendingPullIntos\").push(L);const N=@readableStreamAddReadIntoRequest(A);return @readableByteStreamControllerCallPullIfNeeded(b),N})\n"; +const char* const s_readableByteStreamInternalsReadableByteStreamControllerPullIntoCode = "(function (_,A){\"use strict\";const b=@getByIdDirectPrivate(_,\"controlledReadableStream\");let d=1;if(A.BYTES_PER_ELEMENT!==@undefined)d=A.BYTES_PER_ELEMENT;const k=A.constructor,E={buffer:A.buffer,byteOffset:A.byteOffset,byteLength:A.byteLength,bytesFilled:0,elementSize:d,ctor:k,readerType:\"byob\"};var L=@getByIdDirectPrivate(_,\"pendingPullIntos\");if(L\?.isNotEmpty())return E.buffer=@transferBufferToCurrentRealm(E.buffer),L.push(E),@readableStreamAddReadIntoRequest(b);if(@getByIdDirectPrivate(b,\"state\")===@streamClosed){const R=new k(E.buffer,E.byteOffset,0);return @createFulfilledPromise({value:R,done:!0})}if(@getByIdDirectPrivate(_,\"queue\").size>0){if(@readableByteStreamControllerFillDescriptorFromQueue(_,E)){const R=@readableByteStreamControllerConvertDescriptor(E);return @readableByteStreamControllerHandleQueueDrain(_),@createFulfilledPromise({value:R,done:!1})}if(@getByIdDirectPrivate(_,\"closeRequested\")){const R=@makeTypeError(\"Closing stream has been requested\");return @readableByteStreamControllerError(_,R),@Promise.@reject(R)}}E.buffer=@transferBufferToCurrentRealm(E.buffer),@getByIdDirectPrivate(_,\"pendingPullIntos\").push(E);const N=@readableStreamAddReadIntoRequest(b);return @readableByteStreamControllerCallPullIfNeeded(_),N})\n"; // readableStreamAddReadIntoRequest const JSC::ConstructAbility s_readableByteStreamInternalsReadableStreamAddReadIntoRequestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct; @@ -2952,7 +2952,7 @@ const JSC::ConstructorKind s_eventSourceGetEventSourceCodeConstructorKind = JSC: const JSC::ImplementationVisibility s_eventSourceGetEventSourceCodeImplementationVisibility = JSC::ImplementationVisibility::Public; const int s_eventSourceGetEventSourceCodeLength = 5477; static const JSC::Intrinsic s_eventSourceGetEventSourceCodeIntrinsic = JSC::NoIntrinsic; -const char* const s_eventSourceGetEventSourceCode = "(function (){\"use strict\";class j extends EventTarget{#Q;#B;#F;#G;#J;#U=!1;#V=null;#W=\"\";#M=\"\";#$=\"\";#j=!0;#X=0;#Y=0;#Z=0;#O=null;static#K(V){V.#A()}static#w(V,w){const A=V.data,L=A.#$\?`Last-Event-ID: ${A.#$}\\r\\n`:\"\",U=`GET ${w.pathname}${w.search} HTTP/1.1\\r\\nHost: bun\\r\\nContent-type: text/event-stream\\r\\nContent-length: 0\\r\\n${L}\\r\\n`,W=V.write(U);if(W!==U.length)A.#M=U.substring(W)}static#L(V,w,A){for(;;){if(A>=w.length)return;let L=-1,U=w.indexOf(\"\\r\\n\",A);const W=U+2;if(U>0)if(V.#X===0){const z=parseInt(w.substring(A,U),16);if(z===0){V.#B=2,V.#V\?.end();return}L=W+z}else L=w.length;else{if(V.#W.length===0){V.#W+=w.substring(A);return}L=w.length}let X=w.substring(W,L);A=L+2;let Y=0,B=X.indexOf(\"\\n\\n\");if(B==-1){V.#W+=w.substring(W);return}if(V.#W.length)V.#W+=X,X=V.#W,V.#W=\"\";let Z=!0;while(Z){const z=X.substring(Y,B);let F,M=\"\",O,G=0,J=-1;for(;;){let K=z.indexOf(\"\\n\",G);if(K===-1){if(G>=z.length)break;K=z.length}const Q=z.substring(G,K);if(Q.startsWith(\"data:\"))if(M.length)M+=`\\n${Q.substring(5).trim()}`;else M=Q.substring(5).trim();else if(Q.startsWith(\"event:\"))F=Q.substring(6).trim();else if(Q.startsWith(\"id:\"))O=Q.substring(3).trim();else if(Q.startsWith(\"retry:\")){if(J=parseInt(Q.substring(6).trim(),10),@isNaN(J))J=-1}G=K+1}if(V.#$=O||\"\",J>=0)V.#Z=J;if(M||O||F)V.dispatchEvent(new MessageEvent(F||\"message\",{data:M||\"\",origin:V.#Q.origin,source:V,lastEventId:O}));if(X.length===B+2){Z=!1;break}const H=X.indexOf(\"\\n\\n\",B+1);if(H===-1)break;Y=B,B=H}}}static#z={open(V){const w=V.data;if(w.#V=V,!w.#U)j.#w(V,w.#Q)},handshake(V,w,A){const L=V.data;if(w)j.#w(V,L.#Q);else L.#B=2,L.dispatchEvent(new ErrorEvent(\"error\",{error:A})),V.end()},data(V,w){const A=V.data;switch(A.#B){case 0:{let L=w.toString();const U=L.indexOf(\"\\r\\n\\r\\n\");if(U===-1){A.#W+=L;return}if(A.#W.length)A.#W+=L,L=A.#W,A.#W=\"\";const W=L.substring(0,U),X=W.indexOf(\"\\r\\n\");if(X===-1){A.#B=2,A.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Invalid HTTP request\")})),V.end();return}const Y=W.substring(0,X);if(Y!==\"HTTP/1.1 200 OK\"){A.#B=2,A.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(Y)})),V.end();return}let B=X+1,Z=!1,z=-1;for(;;){let M=W.indexOf(\"\\r\\n\",B);if(M===-1){if(B>=W.length){if(!Z)A.#B=2,A.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's response has no MIME type and \"text/event-stream\" is required. Aborting the connection.`)})),V.end();return}M=W.length}const O=W.substring(B+1,M),G=O.indexOf(\":\"),J=O.substring(0,G),H=J.localeCompare(\"content-type\",@undefined,{sensitivity:\"accent\"})===0;if(B=M+1,H)if(O.endsWith(\" text/event-stream\"))Z=!0;else{A.#B=2,A.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's response has a MIME type that is not \"text/event-stream\". Aborting the connection.`)})),V.end();return}else if(J.localeCompare(\"content-length\",@undefined,{sensitivity:\"accent\"})===0){if(z=parseInt(O.substring(G+1).trim(),10),@isNaN(z)||z<=0){A.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's Content-Length is invalid. Aborting the connection.`)})),V.end();return}if(Z)break}else if(J.localeCompare(\"transfer-encoding\",@undefined,{sensitivity:\"accent\"})===0){if(O.substring(G+1).trim()!==\"chunked\"){A.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's Transfer-Encoding is invalid. Aborting the connection.`)})),V.end();return}if(z=0,Z)break}}A.#X=z,A.#B=1,A.dispatchEvent(new Event(\"open\"));const F=L.substring(U+4);if(j.#L(A,F,0),A.#X>0){if(A.#Y+=F.length,A.#Y>=A.#X)A.#B=2,V.end()}return}case 1:if(j.#L(A,w.toString(),2),A.#X>0){if(A.#Y+=w.byteLength,A.#Y>=A.#X)A.#B=2,V.end()}return;default:break}},drain(V){const w=V.data;if(w.#B===0){const A=w.#W;if(A.length){const L=V.write(A);if(L!==A.length)V.data.#M=A.substring(L);else V.data.#M=\"\"}}},close:j.#H,end(V){j.#H(V).dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Connection closed by server\")}))},timeout(V){j.#H(V).dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Timeout\")}))},binaryType:\"buffer\"};static#H(V){const w=V.data;if(w.#V=null,w.#Y=0,w.#B=2,w.#j){if(w.#O)clearTimeout(w.#O);w.#O=setTimeout(j.#K,w.#Z,w)}return w}constructor(V,w=@undefined){super();const A=new URL(V);this.#U=A.protocol===\"https:\",this.#Q=A,this.#B=2,process.nextTick(j.#K,this)}ref(){this.#O\?.ref(),this.#V\?.ref()}unref(){this.#O\?.unref(),this.#V\?.unref()}#A(){if(this.#B!==2)return;const V=this.#Q,w=this.#U;this.#B=0,@Bun.connect({data:this,socket:j.#z,hostname:V.hostname,port:parseInt(V.port||(w\?\"443\":\"80\"),10),tls:w\?{requestCert:!0,rejectUnauthorized:!1}:!1}).catch((A)=>{if(super.dispatchEvent(new ErrorEvent(\"error\",{error:A})),this.#j){if(this.#O)this.#O.unref\?.();this.#O=setTimeout(j.#K,1000,this)}})}get url(){return this.#Q.href}get readyState(){return this.#B}close(){this.#j=!1,this.#B=2,this.#V\?.unref(),this.#V\?.end()}get onopen(){return this.#J}get onerror(){return this.#F}get onmessage(){return this.#G}set onopen(V){if(this.#J)super.removeEventListener(\"close\",this.#J);super.addEventListener(\"open\",V),this.#J=V}set onerror(V){if(this.#F)super.removeEventListener(\"error\",this.#F);super.addEventListener(\"error\",V),this.#F=V}set onmessage(V){if(this.#G)super.removeEventListener(\"message\",this.#G);super.addEventListener(\"message\",V),this.#G=V}}return Object.defineProperty(j.prototype,\"CONNECTING\",{enumerable:!0,value:0}),Object.defineProperty(j.prototype,\"OPEN\",{enumerable:!0,value:1}),Object.defineProperty(j.prototype,\"CLOSED\",{enumerable:!0,value:2}),j[Symbol.for(\"CommonJS\")]=0,j})\n"; +const char* const s_eventSourceGetEventSourceCode = "(function (){\"use strict\";class B extends EventTarget{#$;#j;#w;#A;#B;#F=!1;#G=null;#J=\"\";#K=\"\";#L=\"\";#M=!0;#O=0;#Q=0;#U=0;#V=null;static#W(W){W.#H()}static#X(W,Q){const F=W.data,G=F.#L\?`Last-Event-ID: ${F.#L}\\r\\n`:\"\",j=`GET ${Q.pathname}${Q.search} HTTP/1.1\\r\\nHost: bun\\r\\nContent-type: text/event-stream\\r\\nContent-length: 0\\r\\n${G}\\r\\n`,X=W.write(j);if(X!==j.length)F.#K=j.substring(X)}static#Y(W,Q,F){for(;;){if(F>=Q.length)return;let G=-1,j=Q.indexOf(\"\\r\\n\",F);const X=j+2;if(j>0)if(W.#O===0){const z=parseInt(Q.substring(F,j),16);if(z===0){W.#j=2,W.#G\?.end();return}G=X+z}else G=Q.length;else{if(W.#J.length===0){W.#J+=Q.substring(F);return}G=Q.length}let Y=Q.substring(X,G);F=G+2;let J=0,Z=Y.indexOf(\"\\n\\n\");if(Z==-1){W.#J+=Q.substring(X);return}if(W.#J.length)W.#J+=Y,Y=W.#J,W.#J=\"\";let K=!0;while(K){const z=Y.substring(J,Z);let L,w=\"\",A,H=0,M=-1;for(;;){let U=z.indexOf(\"\\n\",H);if(U===-1){if(H>=z.length)break;U=z.length}const V=z.substring(H,U);if(V.startsWith(\"data:\"))if(w.length)w+=`\\n${V.substring(5).trim()}`;else w=V.substring(5).trim();else if(V.startsWith(\"event:\"))L=V.substring(6).trim();else if(V.startsWith(\"id:\"))A=V.substring(3).trim();else if(V.startsWith(\"retry:\")){if(M=parseInt(V.substring(6).trim(),10),@isNaN(M))M=-1}H=U+1}if(W.#L=A||\"\",M>=0)W.#U=M;if(w||A||L)W.dispatchEvent(new MessageEvent(L||\"message\",{data:w||\"\",origin:W.#$.origin,source:W,lastEventId:A}));if(Y.length===Z+2){K=!1;break}const O=Y.indexOf(\"\\n\\n\",Z+1);if(O===-1)break;J=Z,Z=O}}}static#Z={open(W){const Q=W.data;if(Q.#G=W,!Q.#F)B.#X(W,Q.#$)},handshake(W,Q,F){const G=W.data;if(Q)B.#X(W,G.#$);else G.#j=2,G.dispatchEvent(new ErrorEvent(\"error\",{error:F})),W.end()},data(W,Q){const F=W.data;switch(F.#j){case 0:{let G=Q.toString();const j=G.indexOf(\"\\r\\n\\r\\n\");if(j===-1){F.#J+=G;return}if(F.#J.length)F.#J+=G,G=F.#J,F.#J=\"\";const X=G.substring(0,j),Y=X.indexOf(\"\\r\\n\");if(Y===-1){F.#j=2,F.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Invalid HTTP request\")})),W.end();return}const J=X.substring(0,Y);if(J!==\"HTTP/1.1 200 OK\"){F.#j=2,F.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(J)})),W.end();return}let Z=Y+1,K=!1,z=-1;for(;;){let w=X.indexOf(\"\\r\\n\",Z);if(w===-1){if(Z>=X.length){if(!K)F.#j=2,F.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's response has no MIME type and \"text/event-stream\" is required. Aborting the connection.`)})),W.end();return}w=X.length}const A=X.substring(Z+1,w),H=A.indexOf(\":\"),M=A.substring(0,H),O=M.localeCompare(\"content-type\",@undefined,{sensitivity:\"accent\"})===0;if(Z=w+1,O)if(A.endsWith(\" text/event-stream\"))K=!0;else{F.#j=2,F.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's response has a MIME type that is not \"text/event-stream\". Aborting the connection.`)})),W.end();return}else if(M.localeCompare(\"content-length\",@undefined,{sensitivity:\"accent\"})===0){if(z=parseInt(A.substring(H+1).trim(),10),@isNaN(z)||z<=0){F.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's Content-Length is invalid. Aborting the connection.`)})),W.end();return}if(K)break}else if(M.localeCompare(\"transfer-encoding\",@undefined,{sensitivity:\"accent\"})===0){if(A.substring(H+1).trim()!==\"chunked\"){F.dispatchEvent(new ErrorEvent(\"error\",{error:new Error(`EventSource's Transfer-Encoding is invalid. Aborting the connection.`)})),W.end();return}if(z=0,K)break}}F.#O=z,F.#j=1,F.dispatchEvent(new Event(\"open\"));const L=G.substring(j+4);if(B.#Y(F,L,0),F.#O>0){if(F.#Q+=L.length,F.#Q>=F.#O)F.#j=2,W.end()}return}case 1:if(B.#Y(F,Q.toString(),2),F.#O>0){if(F.#Q+=Q.byteLength,F.#Q>=F.#O)F.#j=2,W.end()}return;default:break}},drain(W){const Q=W.data;if(Q.#j===0){const F=Q.#J;if(F.length){const G=W.write(F);if(G!==F.length)W.data.#K=F.substring(G);else W.data.#K=\"\"}}},close:B.#z,end(W){B.#z(W).dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Connection closed by server\")}))},timeout(W){B.#z(W).dispatchEvent(new ErrorEvent(\"error\",{error:new Error(\"Timeout\")}))},binaryType:\"buffer\"};static#z(W){const Q=W.data;if(Q.#G=null,Q.#Q=0,Q.#j=2,Q.#M){if(Q.#V)clearTimeout(Q.#V);Q.#V=setTimeout(B.#W,Q.#U,Q)}return Q}constructor(W,Q=@undefined){super();const F=new URL(W);this.#F=F.protocol===\"https:\",this.#$=F,this.#j=2,process.nextTick(B.#W,this)}ref(){this.#V\?.ref(),this.#G\?.ref()}unref(){this.#V\?.unref(),this.#G\?.unref()}#H(){if(this.#j!==2)return;const W=this.#$,Q=this.#F;this.#j=0,@Bun.connect({data:this,socket:B.#Z,hostname:W.hostname,port:parseInt(W.port||(Q\?\"443\":\"80\"),10),tls:Q\?{requestCert:!0,rejectUnauthorized:!1}:!1}).catch((F)=>{if(super.dispatchEvent(new ErrorEvent(\"error\",{error:F})),this.#M){if(this.#V)this.#V.unref\?.();this.#V=setTimeout(B.#W,1000,this)}})}get url(){return this.#$.href}get readyState(){return this.#j}close(){this.#M=!1,this.#j=2,this.#G\?.unref(),this.#G\?.end()}get onopen(){return this.#B}get onerror(){return this.#w}get onmessage(){return this.#A}set onopen(W){if(this.#B)super.removeEventListener(\"close\",this.#B);super.addEventListener(\"open\",W),this.#B=W}set onerror(W){if(this.#w)super.removeEventListener(\"error\",this.#w);super.addEventListener(\"error\",W),this.#w=W}set onmessage(W){if(this.#A)super.removeEventListener(\"message\",this.#A);super.addEventListener(\"message\",W),this.#A=W}}return Object.defineProperty(B.prototype,\"CONNECTING\",{enumerable:!0,value:0}),Object.defineProperty(B.prototype,\"OPEN\",{enumerable:!0,value:1}),Object.defineProperty(B.prototype,\"CLOSED\",{enumerable:!0,value:2}),B[Symbol.for(\"CommonJS\")]=0,B})\n"; #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \ diff --git a/src/js/out/modules/node/http.js b/src/js/out/modules/node/http.js index ab0d68e96..0a84f42b7 100644 --- a/src/js/out/modules/node/http.js +++ b/src/js/out/modules/node/http.js @@ -168,19 +168,19 @@ var { URL } = globalThis, { newArrayWithSize, String, Object, Array } = globalTh }; class Agent extends EventEmitter { - #defaultPort = 80; - #protocol = "http:"; - #options; - #requests; - #sockets; - #freeSockets; - #keepAliveMsecs; - #keepAlive; - #maxSockets; - #maxFreeSockets; - #scheduling; - #maxTotalSockets; - #totalSocketCount; + defaultPort = 80; + protocol = "http:"; + options; + requests; + sockets; + freeSockets; + keepAliveMsecs; + keepAlive; + maxSockets; + maxFreeSockets; + scheduling; + maxTotalSockets; + totalSocketCount; #fakeSocket; static get globalAgent() { return _globalAgent ??= new Agent; @@ -190,48 +190,9 @@ class Agent extends EventEmitter { } constructor(options = kEmptyObject) { super(); - if (this.#options = options = { ...options, path: null }, options.noDelay === void 0) + if (this.options = options = { ...options, path: null }, options.noDelay === void 0) options.noDelay = !0; - this.#requests = kEmptyObject, this.#sockets = kEmptyObject, this.#freeSockets = kEmptyObject, this.#keepAliveMsecs = options.keepAliveMsecs || 1000, this.#keepAlive = options.keepAlive || !1, this.#maxSockets = options.maxSockets || Agent.defaultMaxSockets, this.#maxFreeSockets = options.maxFreeSockets || 256, this.#scheduling = options.scheduling || "lifo", this.#maxTotalSockets = options.maxTotalSockets, this.#totalSocketCount = 0, this.#defaultPort = options.defaultPort || 80, this.#protocol = options.protocol || "http:"; - } - get defaultPort() { - return this.#defaultPort; - } - get protocol() { - return this.#protocol; - } - get requests() { - return this.#requests; - } - get sockets() { - return this.#sockets; - } - get freeSockets() { - return this.#freeSockets; - } - get options() { - return this.#options; - } - get keepAliveMsecs() { - return this.#keepAliveMsecs; - } - get keepAlive() { - return this.#keepAlive; - } - get maxSockets() { - return this.#maxSockets; - } - get maxFreeSockets() { - return this.#maxFreeSockets; - } - get scheduling() { - return this.#scheduling; - } - get maxTotalSockets() { - return this.#maxTotalSockets; - } - get totalSocketCount() { - return this.#totalSocketCount; + this.requests = kEmptyObject, this.sockets = kEmptyObject, this.freeSockets = kEmptyObject, this.keepAliveMsecs = options.keepAliveMsecs || 1000, this.keepAlive = options.keepAlive || !1, this.maxSockets = options.maxSockets || Agent.defaultMaxSockets, this.maxFreeSockets = options.maxFreeSockets || 256, this.scheduling = options.scheduling || "lifo", this.maxTotalSockets = options.maxTotalSockets, this.totalSocketCount = 0, this.defaultPort = options.defaultPort || 80, this.protocol = options.protocol || "http:"; } createConnection() { return debug(`${NODE_HTTP_WARNING}\n`, "WARN: Agent.createConnection is a no-op, returns fake socket"), this.#fakeSocket ??= new FakeSocket; |