Rewrite AppDomain to handle uncaughts & promises

This commit is contained in:
2022-04-06 13:51:04 +09:00
parent 7dedaf8d77
commit 5674f3936c
9 changed files with 137 additions and 91 deletions
+2 -2
View File
@@ -57,7 +57,7 @@ class HttpRequest extends EventEmitter
{
this.Method = "POST";
this.Headers[ "Content-Type" ] = "application/x-www-form-urlencoded";
this.RawPostData = Data == undefined ? new Buffer([]) : new Buffer( Data );
this.RawPostData = Data == undefined ? Buffer.alloc( 0 ) : Buffer.from( Data );
this.Headers[ "Content-Length" ] = this.RawPostData.length;
}
@@ -88,7 +88,7 @@ class HttpRequest extends EventEmitter
OnResponseReceived( Response )
{
var ResponseData = new Buffer( 0 );
var ResponseData = Buffer.alloc( 0 );
Response.addListener( "data",
Data => ResponseData = Buffer.concat([ ResponseData, Data ])