1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-24 12:13:16 +00:00

1. Fixed bug with uncaught rejections in promise.js

2. Updated DHCP.info to support mac address entry
3. Updated clipboard to be able to force single line entry for addModule
This commit is contained in:
Bryan Roe
2021-07-23 16:04:54 -07:00
parent ad961128a2
commit a41983ee7a
4 changed files with 49 additions and 11 deletions

View File

@@ -85,11 +85,11 @@ function nativeAddCompressedModule(name)
}
module.exports(ret);
}
function nativeAddModule(name)
function nativeAddModule(name,single)
{
var value = getJSModule(name);
var ret = "duk_peval_string_noresult(ctx, \"addModule('" + name + "', Buffer.from('" + Buffer.from(value).toString('base64') + "', 'base64').toString());\");";
if (ret.length > 16300)
if (ret.length > 16300 && (single==null || single==false))
{
// MS Visual Studio has a maxsize limitation
var tmp = Buffer.from(value).toString('base64');

File diff suppressed because one or more lines are too long

View File

@@ -116,17 +116,20 @@ function Promise(promiseFunc)
//if (eventName == 'rejected' && (eventCallback.internal == null || eventCallback.internal == false))
if (eventName == 'rejected')
{
var rp = getRootPromise(this.promise);
rp._internal.external = true;
if (this.uncaught != null)
{
clearImmediate(this.uncaught);
this.uncaught = null;
}
if (rp._internal.uncaught != null)
if (this.promise)
{
clearImmediate(rp._internal.uncaught);
rp._internal.uncaught = null;
var rp = getRootPromise(this.promise);
rp._internal.external = true;
if (rp._internal.uncaught != null)
{
clearImmediate(rp._internal.uncaught);
rp._internal.uncaught = null;
}
}
}
@@ -293,6 +296,19 @@ function Promise(promiseFunc)
this._internal.once('settled', (function ()
{
if (this.uncaught != null)
{
clearImmediate(this.uncaught);
this.uncaught = null;
}
var rp = getRootPromise(this.promise);
if (rp && rp._internal.uncaught)
{
clearImmediate(rp._internal.uncaught);
rp._internal.uncaught = null;
}
delete this.promise._up;
delete this.promise.__childPromise;
delete this.promise.promise;