Skip to content

Commit

Permalink
Update CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
codenirvana committed Jun 6, 2024
1 parent 60654f3 commit a6080df
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
unreleased:
new feature:
- Replaced Node VM with Worker threads
- GH-666 Replaced Node VM with Worker threads
breaking changes:
- GH-668 Dropped support for Node < v16
chores:
Expand Down
4 changes: 3 additions & 1 deletion lib/bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Flatted = require('flatted'),
__uvm_setTimeout(() => { throw error; }, 0);
}
__uvm_emit('[["1"],"load.${id}"]');
__uvm_emit('${Flatted.stringify(['load.' + id])}');
__uvm_emit = null; delete __uvm_emit;
__uvm_setTimeout = null; delete __uvm_setTimeout;
`;
Expand All @@ -70,6 +70,7 @@ module.exports = function (bridge, options, callback) {

// function to forward messages emitted
forwardEmits = (e) => {
// e.data for Web Worker (MessageEvent.data)
const { __emit_uvm, __id_uvm } = e?.data || e || /* istanbul ignore next */ {};

/* istanbul ignore next-line */
Expand Down Expand Up @@ -148,6 +149,7 @@ module.exports = function (bridge, options, callback) {

/* istanbul ignore else */
if (typeof worker.addEventListener !== 'function') {
// add event listener methods for Node.js worker
worker.addEventListener = worker.on.bind(worker);
worker.removeEventListener = worker.off.bind(worker);
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/errors.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ describe('uvm errors', function () {
});
});

// FIX: On web the test runner exits before the `exit` event with an error, causing the test to fail.
// FIXME: On web the test runner exits before the `exit` event with an error, causing the test to fail.
(isNode ? describe : describe.skip)('when uncaughtException is not handled', function () {
it('should only trigger error event on synchronous error and terminate', function (done) {
uvm.spawn({
Expand Down

0 comments on commit a6080df

Please sign in to comment.