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

isolated-vm

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isolated-vm - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

package.json
{
"name": "isolated-vm",
"version": "2.0.0",
"version": "2.0.1",
"description": "Access to multiple isolates",

@@ -5,0 +5,0 @@ "main": "isolated-vm.js",

@@ -48,6 +48,3 @@ [![npm version](https://badgen.now.sh/npm/v/isolated-vm)](https://www.npmjs.com/package/isolated-vm)

If you are using Ubuntu please note that version 16 (Xenial) or greater is required. This project
will *not* build using gcc 4.9.
WHO IS USING ISOLATED-VM

@@ -54,0 +51,0 @@ ------------------------

@@ -64,2 +64,4 @@ 'use strict';

// Test dead promise (This causes a memory leak! Don't do this!)
// Disabled test because `timeout` is now paused when the isolate is not active.
/*
global.setSync('deadPromise', new ivm.Reference(function() {

@@ -69,1 +71,2 @@ return new Promise(() => {});

isolate.compileScriptSync('deadPromise.applySyncPromise(undefined, [])').run(context, { timeout: 1 }).catch(() => 0);
*/
'use strict';
let v8 = require('v8');
let ivm = require('isolated-vm');
const v8 = require('v8');
const ivm = require('isolated-vm');
const assert = require('assert');

@@ -91,1 +92,34 @@ // Get the error chain set up

}
// Try custom errors
{
let isolate = new ivm.Isolate;
let context = isolate.createContextSync();
let script = isolate.compileScriptSync(`
class Hello extends Error {
get name() { return 'Hello';}
};
throw new Hello('message');
`);
try {
script.runSync(context);
assert.fail('Did not throw');
} catch (err) {
assert.equal(err.name, 'Hello');
assert.equal(err.message, 'message');
}
}
// Check errors with newlines in message
{
let isolate = new ivm.Isolate;
let context = isolate.createContextSync();
let script = isolate.compileScriptSync('throw new Error("HELLO\\nWORLD")');
try {
script.runSync(context);
assert.fail('Did not throw');
} catch (err) {
assert.equal(err.stack.match(/HELLO/g).length, 1);
assert.equal(err.stack.match(/WORLD/g).length, 1);
}
}

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

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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