New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

uvm

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uvm - npm Package Compare versions

Comparing version 1.6.0 to 1.6.1-beta.1

3

CHANGELOG.md
# Postman UVM Changelog
#### Unreleased
* add ability to remove all events when only event name is provided to `bridge.off`
#### 1.6.0 (May 30, 2017)

@@ -4,0 +7,0 @@ * add support for removal of bridge events (internal) using `bridge.off`

@@ -46,5 +46,9 @@ /**

var e = this._events[name],
i = e && this._events[name].length;
i = e && e.length || 0;
if (!e) { return; }
if (arguments.length === 1) {
return delete this._events[name];
}
if (typeof listener === 'function' && (i >= 1)) {

@@ -51,0 +55,0 @@ while (i >= 0) {

2

package.json
{
"name": "uvm",
"version": "1.6.0",
"version": "1.6.1-beta.1",
"description": "Universal Virtual Machine for Node and Browser",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -196,2 +196,55 @@ var vm = require('vm');

it('must be able to remove all events of a name', function (done) {
var context = vm.createContext({
expect: expect,
assertion: {
one: 0,
two: 0
},
__uvm_emit: function () {
throw new Error('Nothing should be emitted');
},
done: function (err) {
expect(err).to.not.be.ok();
expect(context).to.have.property('assertion');
expect(context.assertion).to.eql({
one: 1,
two: 0
});
done();
}
});
vm.runInContext(bridgeClient(), context);
// run a code that listens to same event
// and makes changes to a global object`
vm.runInContext(`
/* global assertion, done */
bridge.on('loopback', function () {
expect(assertion.one).be(0);
expect(assertion.two).be(0);
assertion.one += 1;
});
bridge.emit('loopback');
bridge.on('loopback', function () {
expect(assertion.one).be(1);
expect(assertion.two).be(0);
assertion.one += 1;
assertion.two += 1;
done('error');
});
bridge.off('loopback'); // remove all events
bridge.emit('loopback');
done();
`, context);
});
it('must not leave behind any additional globals except `bridge` related', function (done) {

@@ -198,0 +251,0 @@ var context = vm.createContext({

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc