diff --git a/CHANGELOG.yaml b/CHANGELOG.yaml index 8f2ade3..f72d4ca 100644 --- a/CHANGELOG.yaml +++ b/CHANGELOG.yaml @@ -1,3 +1,8 @@ +2.1.1: + date: 2022-07-12 + fixed bugs: + - Removed global bridge access in `bridge.once` listener + 2.1.0: date: 2022-07-11 new features: diff --git a/lib/bridge-client.js b/lib/bridge-client.js index d021c14..3f4d0bf 100644 --- a/lib/bridge-client.js +++ b/lib/bridge-client.js @@ -47,9 +47,10 @@ module.exports = function (bootCode) { }, once: function (name, listener) { - bridge.on(name, function fn () { - bridge.off(name, fn); - listener.apply(this, arguments); + const self = this; + self.on(name, function fn () { + self.off(name, fn); + listener.apply(self, arguments); }); }, diff --git a/package-lock.json b/package-lock.json index 57ab158..34501f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "uvm", - "version": "2.1.0", + "version": "2.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 352677b..0d2e214 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uvm", - "version": "2.1.0", + "version": "2.1.1", "description": "Universal Virtual Machine for Node and Browser", "author": "Postman Inc.", "license": "Apache-2.0",