@dxos/codec-protobuf
Advanced tools
Comparing version 2.19.9 to 2.19.10-dev.1130d7c5
@@ -34,3 +34,9 @@ "use strict"; | ||
if (this._messageHandler) { | ||
this._messageHandler(msg); | ||
try { | ||
this._messageHandler(msg); | ||
} | ||
catch (error) { | ||
// Stop error propagation. | ||
throwUnhandledRejection(error); | ||
} | ||
} | ||
@@ -50,3 +56,9 @@ else { | ||
(_a = this._dispose) === null || _a === void 0 ? void 0 : _a.call(this); | ||
(_b = this._closeHandler) === null || _b === void 0 ? void 0 : _b.call(this, err); | ||
try { | ||
(_b = this._closeHandler) === null || _b === void 0 ? void 0 : _b.call(this, err); | ||
} | ||
catch (error) { | ||
// Stop error propagation. | ||
throwUnhandledRejection(error); | ||
} | ||
} | ||
@@ -82,3 +94,9 @@ }); | ||
for (const message of this._buffer) { | ||
onMessage(message); | ||
try { | ||
onMessage(message); | ||
} | ||
catch (error) { | ||
// Stop error propagation. | ||
throwUnhandledRejection(error); | ||
} | ||
} | ||
@@ -112,2 +130,16 @@ this._buffer = null; | ||
exports.Stream = Stream; | ||
/** | ||
* Asynchronously produces an unhandled rejection. | ||
* | ||
* Will terminate the node process with an error. | ||
* In browser results in an error message in the console. | ||
* In mocha tests it fails the currently running test. | ||
* | ||
* NOTE: Copied from @dxos/debug to avoid circular dependency. | ||
*/ | ||
function throwUnhandledRejection(error) { | ||
setTimeout(() => { | ||
throw error; | ||
}); | ||
} | ||
//# sourceMappingURL=stream.js.map |
{ | ||
"name": "@dxos/codec-protobuf", | ||
"version": "2.19.9", | ||
"version": "2.19.10-dev.1130d7c5", | ||
"license": "AGPL-3.0", | ||
@@ -5,0 +5,0 @@ "author": "DXOS.org", |
@@ -71,3 +71,8 @@ // | ||
if (this._messageHandler) { | ||
this._messageHandler(msg); | ||
try { | ||
this._messageHandler(msg); | ||
} catch (error: any) { | ||
// Stop error propagation. | ||
throwUnhandledRejection(error); | ||
} | ||
} else { | ||
@@ -86,3 +91,8 @@ assert(this._buffer); | ||
this._dispose?.(); | ||
this._closeHandler?.(err); | ||
try { | ||
this._closeHandler?.(err); | ||
} catch (error: any) { | ||
// Stop error propagation. | ||
throwUnhandledRejection(error); | ||
} | ||
} | ||
@@ -101,3 +111,8 @@ }); | ||
for (const message of this._buffer) { | ||
onMessage(message); | ||
try { | ||
onMessage(message); | ||
} catch (error: any) { | ||
// Stop error propagation. | ||
throwUnhandledRejection(error); | ||
} | ||
} | ||
@@ -134,1 +149,16 @@ this._buffer = null; | ||
} | ||
/** | ||
* Asynchronously produces an unhandled rejection. | ||
* | ||
* Will terminate the node process with an error. | ||
* In browser results in an error message in the console. | ||
* In mocha tests it fails the currently running test. | ||
* | ||
* NOTE: Copied from @dxos/debug to avoid circular dependency. | ||
*/ | ||
function throwUnhandledRejection (error: Error) { | ||
setTimeout(() => { | ||
throw error; | ||
}); | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103367
1379
33
55
7
2