aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar dave caruso <me@paperdave.net> 2023-07-20 17:33:40 -0700
committerGravatar GitHub <noreply@github.com> 2023-07-20 17:33:40 -0700
commit020cf46346a66435b353c3914ef01e8fdc74779a (patch)
tree23a102cebe263fae4cfe7672200e5899584c3aa5
parent134c97a28289e7811d68652caf9feb2e9c80db44 (diff)
downloadbun-020cf46346a66435b353c3914ef01e8fdc74779a.tar.gz
bun-020cf46346a66435b353c3914ef01e8fdc74779a.tar.zst
bun-020cf46346a66435b353c3914ef01e8fdc74779a.zip
Fix builtins again (#3713)
-rw-r--r--src/js/builtins/codegen/index.ts2
-rw-r--r--src/js/out/WebCoreJSBuiltins.cpp12
2 files changed, 7 insertions, 7 deletions
diff --git a/src/js/builtins/codegen/index.ts b/src/js/builtins/codegen/index.ts
index 2984599fd..564b69689 100644
--- a/src/js/builtins/codegen/index.ts
+++ b/src/js/builtins/codegen/index.ts
@@ -229,7 +229,7 @@ $$capture_start$$(${fn.async ? "async " : ""}${
const finalReplacement =
(fn.directives.sloppy ? captured : captured.replace(/function\s*\(.*?\)\s*{/, '$&"use strict";'))
.replace(/^\((async )?function\(/, "($1function (")
- .replace(/__intrinsic__lazy/g, "globalThis[globalThis.Symbol.for('Bun.lazy')]")
+ .replace(/__intrinsic__lazy\(/g, "globalThis[globalThis.Symbol.for('Bun.lazy')](")
.replace(/__intrinsic__/g, "@") + "\n";
bundledFunctions.push({
diff --git a/src/js/out/WebCoreJSBuiltins.cpp b/src/js/out/WebCoreJSBuiltins.cpp
index 07dbf0a05..395d2d8bd 100644
--- a/src/js/out/WebCoreJSBuiltins.cpp
+++ b/src/js/out/WebCoreJSBuiltins.cpp
@@ -1818,9 +1818,9 @@ const char* const s_readableStreamInternalsReadableStreamDefaultControllerCanClo
const JSC::ConstructAbility s_readableStreamInternalsLazyLoadStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInternalsLazyLoadStreamCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInternalsLazyLoadStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInternalsLazyLoadStreamCodeLength = 1709;
+const int s_readableStreamInternalsLazyLoadStreamCodeLength = 1589;
static const JSC::Intrinsic s_readableStreamInternalsLazyLoadStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInternalsLazyLoadStreamCode = "(function (J,P){\"use strict\";var G=@getByIdDirectPrivate(J,\"bunNativeType\"),B=@getByIdDirectPrivate(J,\"bunNativePtr\"),x=globalThis[globalThis.Symbol.for('Bun.lazy')]StreamPrototypeMap.@get(G);if(x===@undefined){let q=function(m){var{c:b,v:f}=this;this.c=@undefined,this.v=@undefined,I(m,b,f)},N=function(m){try{m.close()}catch(b){globalThis.reportError(b)}},O=function(m,b,f,j){j[0]=!1;var y;try{y=Q(m,f,j)}catch(Y){return b.error(Y)}return I(y,b,f)};var z=q,A=N,p=O,[Q,U,W,Z,D,K,X]=globalThis[globalThis.Symbol.for('Bun.lazy')]Load(G),H=[!1],I;I=function m(b,f,j){if(b&&@isPromise(b))return b.then(q.bind({c:f,v:j}),(y)=>f.error(y));else if(typeof b===\"number\")if(j&&j.byteLength===b&&j.buffer===f.byobRequest\?.view\?.buffer)f.byobRequest.respondWithNewView(j);else f.byobRequest.respond(b);else if(b.constructor===@Uint8Array)f.enqueue(b);if(H[0]||b===!1)@enqueueJob(N,f),H[0]=!1};const F=D\?new FinalizationRegistry(D):null;x=class m{constructor(b,f,j){if(this.#f=b,this.#b={},this.pull=this.#j.bind(this),this.cancel=this.#m.bind(this),this.autoAllocateChunkSize=f,j!==@undefined)this.start=(y)=>{y.enqueue(j)};if(F)F.register(this,b,this.#b)}#b;pull;cancel;start;#f;type=\"bytes\";autoAllocateChunkSize=0;static startSync=U;#j(b){var f=this.#f;if(!f){b.close();return}O(f,b,b.byobRequest.view,H)}#m(b){var f=this.#f;F&&F.unregister(this.#b),K&&K(f,!1),W(f,b)}static deinit=D;static drain=X},globalThis[globalThis.Symbol.for('Bun.lazy')]StreamPrototypeMap.@set(G,x)}const L=x.startSync(B,P);var E;const{drain:M,deinit:_}=x;if(M)E=M(B);if(L===0){if(D&&B&&@enqueueJob(D,B),(E\?.byteLength\?\?0)>0)return{start(q){q.enqueue(E),q.close()},type:\"bytes\"};return{start(q){q.close()},type:\"bytes\"}}return new x(B,L,E)})\n";
+const char* const s_readableStreamInternalsLazyLoadStreamCode = "(function (J,P){\"use strict\";var G=@getByIdDirectPrivate(J,\"bunNativeType\"),B=@getByIdDirectPrivate(J,\"bunNativePtr\"),x=@lazyStreamPrototypeMap.@get(G);if(x===@undefined){let q=function(m){var{c:b,v:f}=this;this.c=@undefined,this.v=@undefined,I(m,b,f)},N=function(m){try{m.close()}catch(b){globalThis.reportError(b)}},O=function(m,b,f,j){j[0]=!1;var y;try{y=Q(m,f,j)}catch(Y){return b.error(Y)}return I(y,b,f)};var z=q,A=N,p=O,[Q,U,W,Z,D,K,X]=@lazyLoad(G),H=[!1],I;I=function m(b,f,j){if(b&&@isPromise(b))return b.then(q.bind({c:f,v:j}),(y)=>f.error(y));else if(typeof b===\"number\")if(j&&j.byteLength===b&&j.buffer===f.byobRequest\?.view\?.buffer)f.byobRequest.respondWithNewView(j);else f.byobRequest.respond(b);else if(b.constructor===@Uint8Array)f.enqueue(b);if(H[0]||b===!1)@enqueueJob(N,f),H[0]=!1};const F=D\?new FinalizationRegistry(D):null;x=class m{constructor(b,f,j){if(this.#f=b,this.#b={},this.pull=this.#j.bind(this),this.cancel=this.#m.bind(this),this.autoAllocateChunkSize=f,j!==@undefined)this.start=(y)=>{y.enqueue(j)};if(F)F.register(this,b,this.#b)}#b;pull;cancel;start;#f;type=\"bytes\";autoAllocateChunkSize=0;static startSync=U;#j(b){var f=this.#f;if(!f){b.close();return}O(f,b,b.byobRequest.view,H)}#m(b){var f=this.#f;F&&F.unregister(this.#b),K&&K(f,!1),W(f,b)}static deinit=D;static drain=X},@lazyStreamPrototypeMap.@set(G,x)}const L=x.startSync(B,P);var E;const{drain:M,deinit:_}=x;if(M)E=M(B);if(L===0){if(D&&B&&@enqueueJob(D,B),(E\?.byteLength\?\?0)>0)return{start(q){q.enqueue(E),q.close()},type:\"bytes\"};return{start(q){q.close()},type:\"bytes\"}}return new x(B,L,E)})\n";
// readableStreamIntoArray
const JSC::ConstructAbility s_readableStreamInternalsReadableStreamIntoArrayCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2464,9 +2464,9 @@ WEBCORE_FOREACH_WRITABLESTREAMDEFAULTWRITER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATO
const JSC::ConstructAbility s_readableStreamInitializeReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamInitializeReadableStreamCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamInitializeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_readableStreamInitializeReadableStreamCodeLength = 2263;
+const int s_readableStreamInitializeReadableStreamCodeLength = 2143;
static const JSC::Intrinsic s_readableStreamInitializeReadableStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamInitializeReadableStreamCode = "(function (_,v){\"use strict\";if(_===@undefined)_={@bunNativeType:0,@bunNativePtr:0,globalThis[globalThis.Symbol.for('Bun.lazy')]:!1};if(v===@undefined)v={};if(!@isObject(_))@throwTypeError(\"ReadableStream constructor takes an object as first argument\");if(v!==@undefined&&!@isObject(v))@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),@putByIdDirectPrivate(this,\"asyncContext\",@getInternalField(@asyncContext,0));const B=_.type===\"direct\",R=!!_.globalThis[globalThis.Symbol.for('Bun.lazy')],P=B||R;if(@getByIdDirectPrivate(_,\"pull\")!==@undefined&&!P){const m=@getByIdDirectPrivate(v,\"size\"),f=@getByIdDirectPrivate(v,\"highWaterMark\");return @putByIdDirectPrivate(this,\"highWaterMark\",f),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@setupReadableStreamDefaultController(this,_,m,f!==@undefined\?f:1,@getByIdDirectPrivate(_,\"start\"),@getByIdDirectPrivate(_,\"pull\"),@getByIdDirectPrivate(_,\"cancel\")),this}if(B)@putByIdDirectPrivate(this,\"underlyingSource\",_),@putByIdDirectPrivate(this,\"highWaterMark\",@getByIdDirectPrivate(v,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",()=>@createReadableStreamController(this,_,v));else if(P){const m=_.autoAllocateChunkSize;@putByIdDirectPrivate(this,\"highWaterMark\",@undefined),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"highWaterMark\",m||@getByIdDirectPrivate(v,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",()=>{const f=globalThis[globalThis.Symbol.for('Bun.lazy')]LoadStream(this,m);if(f)@createReadableStreamController(this,f,v)})}else @putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"highWaterMark\",@getByIdDirectPrivate(v,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",@undefined),@createReadableStreamController(this,_,v);return this})\n";
+const char* const s_readableStreamInitializeReadableStreamCode = "(function (_,v){\"use strict\";if(_===@undefined)_={@bunNativeType:0,@bunNativePtr:0,@lazy:!1};if(v===@undefined)v={};if(!@isObject(_))@throwTypeError(\"ReadableStream constructor takes an object as first argument\");if(v!==@undefined&&!@isObject(v))@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),@putByIdDirectPrivate(this,\"asyncContext\",@getInternalField(@asyncContext,0));const B=_.type===\"direct\",R=!!_.@lazy,P=B||R;if(@getByIdDirectPrivate(_,\"pull\")!==@undefined&&!P){const m=@getByIdDirectPrivate(v,\"size\"),f=@getByIdDirectPrivate(v,\"highWaterMark\");return @putByIdDirectPrivate(this,\"highWaterMark\",f),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@setupReadableStreamDefaultController(this,_,m,f!==@undefined\?f:1,@getByIdDirectPrivate(_,\"start\"),@getByIdDirectPrivate(_,\"pull\"),@getByIdDirectPrivate(_,\"cancel\")),this}if(B)@putByIdDirectPrivate(this,\"underlyingSource\",_),@putByIdDirectPrivate(this,\"highWaterMark\",@getByIdDirectPrivate(v,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",()=>@createReadableStreamController(this,_,v));else if(P){const m=_.autoAllocateChunkSize;@putByIdDirectPrivate(this,\"highWaterMark\",@undefined),@putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"highWaterMark\",m||@getByIdDirectPrivate(v,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",()=>{const f=@lazyLoadStream(this,m);if(f)@createReadableStreamController(this,f,v)})}else @putByIdDirectPrivate(this,\"underlyingSource\",@undefined),@putByIdDirectPrivate(this,\"highWaterMark\",@getByIdDirectPrivate(v,\"highWaterMark\")),@putByIdDirectPrivate(this,\"start\",@undefined),@createReadableStreamController(this,_,v);return this})\n";
// readableStreamToArray
const JSC::ConstructAbility s_readableStreamReadableStreamToArrayCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
@@ -2536,9 +2536,9 @@ const char* const s_readableStreamCreateEmptyReadableStreamCode = "(function (){
const JSC::ConstructAbility s_readableStreamCreateNativeReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_readableStreamCreateNativeReadableStreamCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_readableStreamCreateNativeReadableStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Private;
-const int s_readableStreamCreateNativeReadableStreamCodeLength = 169;
+const int s_readableStreamCreateNativeReadableStreamCodeLength = 129;
static const JSC::Intrinsic s_readableStreamCreateNativeReadableStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_readableStreamCreateNativeReadableStreamCode = "(function (d,m,r){\"use strict\";return new @ReadableStream({globalThis[globalThis.Symbol.for('Bun.lazy')]:!0,@bunNativeType:m,@bunNativePtr:d,autoAllocateChunkSize:r})})\n";
+const char* const s_readableStreamCreateNativeReadableStreamCode = "(function (d,m,r){\"use strict\";return new @ReadableStream({@lazy:!0,@bunNativeType:m,@bunNativePtr:d,autoAllocateChunkSize:r})})\n";
// cancel
const JSC::ConstructAbility s_readableStreamCancelCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;