aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-13 02:57:25 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-13 02:57:25 -0700
commit04b4157232006c882cdd693f566b31945618b924 (patch)
tree891ad0bb6561511e0b7d9a5a7dab8176acddbb84 /src
parenta02a79e26c49358e8bde3988709f8b79464711aa (diff)
downloadbun-04b4157232006c882cdd693f566b31945618b924.tar.gz
bun-04b4157232006c882cdd693f566b31945618b924.tar.zst
bun-04b4157232006c882cdd693f566b31945618b924.zip
Fixes #3629
Diffstat (limited to 'src')
-rw-r--r--src/js/builtins/ProcessObjectInternals.ts10
-rw-r--r--src/js/out/WebCoreJSBuiltins.cpp8
2 files changed, 9 insertions, 9 deletions
diff --git a/src/js/builtins/ProcessObjectInternals.ts b/src/js/builtins/ProcessObjectInternals.ts
index 27cad80d0..9670886bd 100644
--- a/src/js/builtins/ProcessObjectInternals.ts
+++ b/src/js/builtins/ProcessObjectInternals.ts
@@ -276,19 +276,19 @@ export function getStdioWriteStream(fd_) {
}
cursorTo(x, y, callback) {
- return (readline ??= require("readline")).cursorTo(this, x, y, callback);
+ return (readline ??= require("node:readline")).cursorTo(this, x, y, callback);
}
moveCursor(dx, dy, callback) {
- return (readline ??= require("readline")).moveCursor(this, dx, dy, callback);
+ return (readline ??= require("node:readline")).moveCursor(this, dx, dy, callback);
}
clearLine(dir, callback) {
- return (readline ??= require("readline")).clearLine(this, dir, callback);
+ return (readline ??= require("node:readline")).clearLine(this, dir, callback);
}
clearScreenDown(callback) {
- return (readline ??= require("readline")).clearScreenDown(this, callback);
+ return (readline ??= require("node:readline")).clearScreenDown(this, callback);
}
// TODO: once implemented this.columns and this.rows should be uncommented
@@ -502,7 +502,7 @@ export function getStdinStream(fd_) {
#onDrain;
get isTTY() {
- return require("tty").isatty(fd_);
+ return require("node:tty").isatty(fd_);
}
get fd() {
diff --git a/src/js/out/WebCoreJSBuiltins.cpp b/src/js/out/WebCoreJSBuiltins.cpp
index b34109cf9..a380322a6 100644
--- a/src/js/out/WebCoreJSBuiltins.cpp
+++ b/src/js/out/WebCoreJSBuiltins.cpp
@@ -646,17 +646,17 @@ const char* const s_processObjectInternalsBindingCode = "(function (u){\"use str
const JSC::ConstructAbility s_processObjectInternalsGetStdioWriteStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_processObjectInternalsGetStdioWriteStreamCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_processObjectInternalsGetStdioWriteStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_processObjectInternalsGetStdioWriteStreamCodeLength = 4311;
+const int s_processObjectInternalsGetStdioWriteStreamCodeLength = 4331;
static const JSC::Intrinsic s_processObjectInternalsGetStdioWriteStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_processObjectInternalsGetStdioWriteStreamCode = "(function (Z){\"use strict\";var L=(M)=>{var G=@requireMap.get(M);if(G)return G.exports;return @internalRequire(M)},D={path:\"node:process\",require:L};function Y(M){var{Duplex:G,eos:j,destroy:z}=L(\"node:stream\"),J=class O extends G{#j;#$;#M=!0;#N=!0;#J;#z;#G;#B;#H;#K;get isTTY(){return this.#K\?\?=L(\"node:tty\").isatty(M)}get fd(){return M}constructor(B){super({readable:!0,writable:!0});this.#J=`/dev/fd/${B}`}#L(B){const H=this.#z;if(this.#z=null,H)H(B);else if(B)this.destroy(B);else if(!this.#M&&!this.#N)this.destroy()}_destroy(B,H){if(!B&&this.#z!==null){var N=class X extends Error{code;name;constructor(Q=\"The operation was aborted\",K=void 0){if(K!==void 0&&typeof K!==\"object\")throw new Error(`Invalid AbortError options:\\n\\n${JSON.stringify(K,null,2)}`);super(Q,K);this.code=\"ABORT_ERR\",this.name=\"AbortError\"}};B=new N}if(this.#G=null,this.#B=null,this.#z===null)H(B);else{if(this.#z=H,this.#j)z(this.#j,B);if(this.#$)z(this.#$,B)}}_write(B,H,N){if(!this.#j){var{createWriteStream:X}=L(\"node:fs\"),Q=this.#j=X(this.#J);Q.on(\"finish\",()=>{if(this.#B){const K=this.#B;this.#B=null,K()}}),Q.on(\"drain\",()=>{if(this.#G){const K=this.#G;this.#G=null,K()}}),j(Q,(K)=>{if(this.#N=!1,K)z(Q,K);this.#L(K)})}if(Q.write(B,H))N();else this.#G=N}_final(B){this.#j&&this.#j.end(),this.#B=B}#O(){var{createReadStream:B}=L(\"node:fs\"),H=this.#$=B(this.#J);return H.on(\"readable\",()=>{if(this.#H){const N=this.#H;this.#H=null,N()}else this.read()}),H.on(\"end\",()=>{this.push(null)}),j(H,(N)=>{if(this.#M=!1,N)z(H,N);this.#L(N)}),H}_read(){var B=this.#$;if(!B)B=this.#O();while(!0){const H=B.read();if(H===null||!this.push(H))return}}};return new J(M)}var{EventEmitter:P}=L(\"node:events\");function V(M){if(!M)return!0;var G=M.toLowerCase();return G===\"utf8\"||G===\"utf-8\"||G===\"buffer\"||G===\"binary\"}var U,A=class M extends P{#j;#$;#M;#N;bytesWritten=0;setDefaultEncoding(G){if(this.#$||!V(G))return this.#G(),this.#$.setDefaultEncoding(G)}#J(){switch(this.#j){case 1:{var G=@Bun.stdout.writer({highWaterMark:0});return G.unref(),G}case 2:{var G=@Bun.stderr.writer({highWaterMark:0});return G.unref(),G}default:throw new Error(\"Unsupported writer\")}}#z(){return this.#M\?\?=this.#J()}constructor(G){super();this.#j=G}get fd(){return this.#j}get isTTY(){return this.#N\?\?=L(\"node:tty\").isatty(this.#j)}cursorTo(G,j,z){return(U\?\?=L(\"readline\")).cursorTo(this,G,j,z)}moveCursor(G,j,z){return(U\?\?=L(\"readline\")).moveCursor(this,G,j,z)}clearLine(G,j){return(U\?\?=L(\"readline\")).clearLine(this,G,j)}clearScreenDown(G){return(U\?\?=L(\"readline\")).clearScreenDown(this,G)}ref(){this.#z().ref()}unref(){this.#z().unref()}on(G,j){if(G===\"close\"||G===\"finish\")return this.#G(),this.#$.on(G,j);if(G===\"drain\")return super.on(\"drain\",j);if(G===\"error\")return super.on(\"error\",j);return super.on(G,j)}get _writableState(){return this.#G(),this.#$._writableState}get _readableState(){return this.#G(),this.#$._readableState}pipe(G){return this.#G(),this.#$.pipe(G)}unpipe(G){return this.#G(),this.#$.unpipe(G)}#G(){if(this.#$)return;this.#$=Y(this.#j);const G=this.eventNames();for(let j of G)this.#$.on(j,(...z)=>{this.emit(j,...z)})}#B(G){var j=this.#z();const z=j.write(G);this.bytesWritten+=z;const J=j.flush(!1);return!!(z||J)}#H(G,j){if(!V(j))return this.#G(),this.#$.write(G,j);return this.#B(G)}#K(G,j){if(j)this.emit(\"error\",j);try{G(j\?j:null)}catch(z){this.emit(\"error\",z)}}#L(G,j,z){if(!V(j))return this.#G(),this.#$.write(G,j,z);var J=this.#z();const O=J.write(G),B=J.flush(!0);if(B\?.then)return B.then(()=>{this.#K(z),this.emit(\"drain\")},(H)=>this.#K(z,H)),!1;return queueMicrotask(()=>{this.#K(z)}),!!(O||B)}write(G,j,z){const J=this._write(G,j,z);if(J)this.emit(\"drain\");return J}get hasColors(){return @Bun.tty[this.#j].hasColors}_write(G,j,z){var J=this.#$;if(J)return J.write(G,j,z);switch(arguments.length){case 0:{var O=new Error(\"Invalid arguments\");throw O.code=\"ERR_INVALID_ARG_TYPE\",O}case 1:return this.#B(G);case 2:if(typeof j===\"function\")return this.#L(G,\"\",j);else if(typeof j===\"string\")return this.#H(G,j);default:{if(typeof j!==\"undefined\"&&typeof j!==\"string\"||typeof z!==\"undefined\"&&typeof z!==\"function\"){var O=new Error(\"Invalid arguments\");throw O.code=\"ERR_INVALID_ARG_TYPE\",O}if(typeof z===\"undefined\")return this.#H(G,j);return this.#L(G,j,z)}}}destroy(){return this}end(){return this}};return new A(Z)})\n";
+const char* const s_processObjectInternalsGetStdioWriteStreamCode = "(function (Z){\"use strict\";var L=(M)=>{var j=@requireMap.get(M);if(j)return j.exports;return @internalRequire(M)},D={path:\"node:process\",require:L};function Y(M){var{Duplex:j,eos:z,destroy:B}=L(\"node:stream\"),J=class O extends j{#z;#$;#M=!0;#N=!0;#J;#B;#j;#G;#H;#K;get isTTY(){return this.#K\?\?=L(\"node:tty\").isatty(M)}get fd(){return M}constructor(G){super({readable:!0,writable:!0});this.#J=`/dev/fd/${G}`}#L(G){const H=this.#B;if(this.#B=null,H)H(G);else if(G)this.destroy(G);else if(!this.#M&&!this.#N)this.destroy()}_destroy(G,H){if(!G&&this.#B!==null){var N=class X extends Error{code;name;constructor(Q=\"The operation was aborted\",K=void 0){if(K!==void 0&&typeof K!==\"object\")throw new Error(`Invalid AbortError options:\\n\\n${JSON.stringify(K,null,2)}`);super(Q,K);this.code=\"ABORT_ERR\",this.name=\"AbortError\"}};G=new N}if(this.#j=null,this.#G=null,this.#B===null)H(G);else{if(this.#B=H,this.#z)B(this.#z,G);if(this.#$)B(this.#$,G)}}_write(G,H,N){if(!this.#z){var{createWriteStream:X}=L(\"node:fs\"),Q=this.#z=X(this.#J);Q.on(\"finish\",()=>{if(this.#G){const K=this.#G;this.#G=null,K()}}),Q.on(\"drain\",()=>{if(this.#j){const K=this.#j;this.#j=null,K()}}),z(Q,(K)=>{if(this.#N=!1,K)B(Q,K);this.#L(K)})}if(Q.write(G,H))N();else this.#j=N}_final(G){this.#z&&this.#z.end(),this.#G=G}#O(){var{createReadStream:G}=L(\"node:fs\"),H=this.#$=G(this.#J);return H.on(\"readable\",()=>{if(this.#H){const N=this.#H;this.#H=null,N()}else this.read()}),H.on(\"end\",()=>{this.push(null)}),z(H,(N)=>{if(this.#M=!1,N)B(H,N);this.#L(N)}),H}_read(){var G=this.#$;if(!G)G=this.#O();while(!0){const H=G.read();if(H===null||!this.push(H))return}}};return new J(M)}var{EventEmitter:P}=L(\"node:events\");function V(M){if(!M)return!0;var j=M.toLowerCase();return j===\"utf8\"||j===\"utf-8\"||j===\"buffer\"||j===\"binary\"}var U,A=class M extends P{#z;#$;#M;#N;bytesWritten=0;setDefaultEncoding(j){if(this.#$||!V(j))return this.#j(),this.#$.setDefaultEncoding(j)}#J(){switch(this.#z){case 1:{var j=@Bun.stdout.writer({highWaterMark:0});return j.unref(),j}case 2:{var j=@Bun.stderr.writer({highWaterMark:0});return j.unref(),j}default:throw new Error(\"Unsupported writer\")}}#B(){return this.#M\?\?=this.#J()}constructor(j){super();this.#z=j}get fd(){return this.#z}get isTTY(){return this.#N\?\?=L(\"node:tty\").isatty(this.#z)}cursorTo(j,z,B){return(U\?\?=L(\"node:readline\")).cursorTo(this,j,z,B)}moveCursor(j,z,B){return(U\?\?=L(\"node:readline\")).moveCursor(this,j,z,B)}clearLine(j,z){return(U\?\?=L(\"node:readline\")).clearLine(this,j,z)}clearScreenDown(j){return(U\?\?=L(\"node:readline\")).clearScreenDown(this,j)}ref(){this.#B().ref()}unref(){this.#B().unref()}on(j,z){if(j===\"close\"||j===\"finish\")return this.#j(),this.#$.on(j,z);if(j===\"drain\")return super.on(\"drain\",z);if(j===\"error\")return super.on(\"error\",z);return super.on(j,z)}get _writableState(){return this.#j(),this.#$._writableState}get _readableState(){return this.#j(),this.#$._readableState}pipe(j){return this.#j(),this.#$.pipe(j)}unpipe(j){return this.#j(),this.#$.unpipe(j)}#j(){if(this.#$)return;this.#$=Y(this.#z);const j=this.eventNames();for(let z of j)this.#$.on(z,(...B)=>{this.emit(z,...B)})}#G(j){var z=this.#B();const B=z.write(j);this.bytesWritten+=B;const J=z.flush(!1);return!!(B||J)}#H(j,z){if(!V(z))return this.#j(),this.#$.write(j,z);return this.#G(j)}#K(j,z){if(z)this.emit(\"error\",z);try{j(z\?z:null)}catch(B){this.emit(\"error\",B)}}#L(j,z,B){if(!V(z))return this.#j(),this.#$.write(j,z,B);var J=this.#B();const O=J.write(j),G=J.flush(!0);if(G\?.then)return G.then(()=>{this.#K(B),this.emit(\"drain\")},(H)=>this.#K(B,H)),!1;return queueMicrotask(()=>{this.#K(B)}),!!(O||G)}write(j,z,B){const J=this._write(j,z,B);if(J)this.emit(\"drain\");return J}get hasColors(){return @Bun.tty[this.#z].hasColors}_write(j,z,B){var J=this.#$;if(J)return J.write(j,z,B);switch(arguments.length){case 0:{var O=new Error(\"Invalid arguments\");throw O.code=\"ERR_INVALID_ARG_TYPE\",O}case 1:return this.#G(j);case 2:if(typeof z===\"function\")return this.#L(j,\"\",z);else if(typeof z===\"string\")return this.#H(j,z);default:{if(typeof z!==\"undefined\"&&typeof z!==\"string\"||typeof B!==\"undefined\"&&typeof B!==\"function\"){var O=new Error(\"Invalid arguments\");throw O.code=\"ERR_INVALID_ARG_TYPE\",O}if(typeof B===\"undefined\")return this.#H(j,z);return this.#L(j,z,B)}}}destroy(){return this}end(){return this}};return new A(Z)})\n";
// getStdinStream
const JSC::ConstructAbility s_processObjectInternalsGetStdinStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
const JSC::ConstructorKind s_processObjectInternalsGetStdinStreamCodeConstructorKind = JSC::ConstructorKind::None;
const JSC::ImplementationVisibility s_processObjectInternalsGetStdinStreamCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
-const int s_processObjectInternalsGetStdinStreamCodeLength = 1861;
+const int s_processObjectInternalsGetStdinStreamCodeLength = 1866;
static const JSC::Intrinsic s_processObjectInternalsGetStdinStreamCodeIntrinsic = JSC::NoIntrinsic;
-const char* const s_processObjectInternalsGetStdinStreamCode = "(function (K){\"use strict\";var H=(I)=>{var N=@requireMap.get(I);if(N)return N.exports;return @internalRequire(I)},T={path:\"node:process\",require:H},{Duplex:M,eos:P,destroy:L}=H(\"node:stream\"),Q=class I extends M{#J;#j;#$;#G=!0;#H=!1;#K=!0;#z;#N;#B;get isTTY(){return H(\"tty\").isatty(K)}get fd(){return K}constructor(){super({readable:!0,writable:!0})}#I(N){const j=this.#N;if(this.#N=null,j)j(N);else if(N)this.destroy(N);else if(!this.#G&&!this.#K)this.destroy()}_destroy(N,j){if(!N&&this.#N!==null){var z=class B extends Error{constructor(G=\"The operation was aborted\",J=void 0){if(J!==void 0&&typeof J!==\"object\")throw new Error(`Invalid AbortError options:\\n\\n${JSON.stringify(J,null,2)}`);super(G,J);this.code=\"ABORT_ERR\",this.name=\"AbortError\"}};N=new z}if(this.#N===null)j(N);else if(this.#N=j,this.#$)L(this.#$,N)}setRawMode(N){}on(N,j){if(N===\"readable\")this.ref(),this.#H=!0;return super.on(N,j)}pause(){return this.unref(),super.pause()}resume(){return this.ref(),super.resume()}ref(){this.#J\?\?=@Bun.stdin.stream().getReader(),this.#j\?\?=setInterval(()=>{},1<<30)}unref(){if(this.#j)clearInterval(this.#j),this.#j=null}async#L(){try{var N,j;const z=this.#J.readMany();if(!z\?.then)({done:N,value:j}=z);else({done:N,value:j}=await z);if(!N){this.push(j[0]);const B=j.length;for(let G=1;G<B;G++)this.push(j[G])}else this.push(null),this.pause(),this.#G=!1,this.#I()}catch(z){this.#G=!1,this.#I(z)}}_read(N){if(this.#H)this.unref(),this.#H=!1;this.#L()}#M(){var{createWriteStream:N}=H(\"node:fs\"),j=this.#$=N(\"/dev/fd/0\");return j.on(\"finish\",()=>{if(this.#z){const z=this.#z;this.#z=null,z()}}),j.on(\"drain\",()=>{if(this.#B){const z=this.#B;this.#B=null,z()}}),P(j,(z)=>{if(this.#K=!1,z)L(j,z);this.#I(z)}),j}_write(N,j,z){var B=this.#$;if(!B)B=this.#M();if(B.write(N,j))z();else this.#B=z}_final(N){this.#$.end(),this.#z=(...j)=>N(...j)}};return new Q})\n";
+const char* const s_processObjectInternalsGetStdinStreamCode = "(function (L){\"use strict\";var H=(J)=>{var j=@requireMap.get(J);if(j)return j.exports;return @internalRequire(J)},T={path:\"node:process\",require:H},{Duplex:N,eos:P,destroy:M}=H(\"node:stream\"),Q=class J extends N{#K;#I;#$;#G=!0;#H=!1;#L=!0;#z;#j;#B;get isTTY(){return H(\"node:tty\").isatty(L)}get fd(){return L}constructor(){super({readable:!0,writable:!0})}#J(j){const I=this.#j;if(this.#j=null,I)I(j);else if(j)this.destroy(j);else if(!this.#G&&!this.#L)this.destroy()}_destroy(j,I){if(!j&&this.#j!==null){var z=class B extends Error{constructor(G=\"The operation was aborted\",K=void 0){if(K!==void 0&&typeof K!==\"object\")throw new Error(`Invalid AbortError options:\\n\\n${JSON.stringify(K,null,2)}`);super(G,K);this.code=\"ABORT_ERR\",this.name=\"AbortError\"}};j=new z}if(this.#j===null)I(j);else if(this.#j=I,this.#$)M(this.#$,j)}setRawMode(j){}on(j,I){if(j===\"readable\")this.ref(),this.#H=!0;return super.on(j,I)}pause(){return this.unref(),super.pause()}resume(){return this.ref(),super.resume()}ref(){this.#K\?\?=@Bun.stdin.stream().getReader(),this.#I\?\?=setInterval(()=>{},1<<30)}unref(){if(this.#I)clearInterval(this.#I),this.#I=null}async#M(){try{var j,I;const z=this.#K.readMany();if(!z\?.then)({done:j,value:I}=z);else({done:j,value:I}=await z);if(!j){this.push(I[0]);const B=I.length;for(let G=1;G<B;G++)this.push(I[G])}else this.push(null),this.pause(),this.#G=!1,this.#J()}catch(z){this.#G=!1,this.#J(z)}}_read(j){if(this.#H)this.unref(),this.#H=!1;this.#M()}#N(){var{createWriteStream:j}=H(\"node:fs\"),I=this.#$=j(\"/dev/fd/0\");return I.on(\"finish\",()=>{if(this.#z){const z=this.#z;this.#z=null,z()}}),I.on(\"drain\",()=>{if(this.#B){const z=this.#B;this.#B=null,z()}}),P(I,(z)=>{if(this.#L=!1,z)M(I,z);this.#J(z)}),I}_write(j,I,z){var B=this.#$;if(!B)B=this.#N();if(B.write(j,I))z();else this.#B=z}_final(j){this.#$.end(),this.#z=(...I)=>j(...I)}};return new Q})\n";
#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \