Comparing version 2.0.0 to 2.0.2
@@ -43,3 +43,3 @@ // Generated by CoffeeScript 1.10.0 | ||
o = new _this.Buffer(value.length); | ||
value.copy(object); | ||
value.copy(o); | ||
} else { | ||
@@ -46,0 +46,0 @@ o = null; |
@@ -27,3 +27,3 @@ // Generated by CoffeeScript 1.10.0 | ||
AVAILABLE_NATIVE_MODULES = ['assert', 'buffer', 'child_process', 'constants', 'crypto', 'tls', 'dgram', 'dns', 'http', 'https', 'net', 'querystring', 'url', 'domain', 'events', 'fs', 'path', 'os', 'punycode', 'stream', 'string_decoder', 'timers', 'tty', 'util', 'sys', 'vm', 'zlib']; | ||
AVAILABLE_NATIVE_MODULES = ['assert', 'buffer', 'child_process', 'constants', 'crypto', 'tls', 'dgram', 'dns', 'http', 'https', 'net', 'querystring', 'url', 'domain', 'events', 'fs', 'path', 'module', 'os', 'punycode', 'stream', 'string_decoder', 'timers', 'tty', 'util', 'sys', 'vm', 'zlib']; | ||
@@ -30,0 +30,0 @@ |
// Generated by CoffeeScript 1.10.0 | ||
var NATIVE_MODULES, Script, noop, | ||
var NATIVE_MODULES, Script, fakeHandlers, noop, | ||
slice = [].slice, | ||
@@ -11,2 +11,4 @@ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, | ||
fakeHandlers = {}; | ||
NATIVE_MODULES = parent.process.binding('natives'); | ||
@@ -257,2 +259,3 @@ | ||
global.process = { | ||
argv: [], | ||
title: parent.process.title, | ||
@@ -276,2 +279,63 @@ version: parent.process.version, | ||
return parent.process.cwd(); | ||
}, | ||
on: function(name, handler) { | ||
var fake; | ||
if (name !== 'beforeExit' && name !== 'exit') { | ||
throw new Error("Access denied to listen for '" + name + "' event."); | ||
} | ||
fake = function() { | ||
return handler.call(null); | ||
}; | ||
if (fakeHandlers[name] == null) { | ||
fakeHandlers[name] = new Map(); | ||
} | ||
fakeHandlers[name].set(handler, fake); | ||
parent.process.on(name, fake); | ||
return this; | ||
}, | ||
once: function(name, handler) { | ||
var fake, ref; | ||
if (name !== 'beforeExit' && name !== 'exit') { | ||
throw new Error("Access denied to listen for '" + name + "' event."); | ||
} | ||
if ((ref = fakeHandlers[name]) != null ? ref.has(handler) : void 0) { | ||
return this; | ||
} | ||
fake = function() { | ||
fakeHandlers[name]["delete"](handler); | ||
return handler.call(null); | ||
}; | ||
if (fakeHandlers[name] == null) { | ||
fakeHandlers[name] = new Map(); | ||
} | ||
fakeHandlers[name].set(handler, fake); | ||
parent.process.once(name, fake); | ||
return this; | ||
}, | ||
listeners: function(name) { | ||
var array; | ||
if (!fakeHandlers[name]) { | ||
return []; | ||
} | ||
array = []; | ||
fakeHandlers[name].forEach(function(value, key) { | ||
return array.push(key); | ||
}); | ||
return array; | ||
}, | ||
removeListener: function(name, handler) { | ||
var fake, ref; | ||
fake = (ref = fakeHandlers[name]) != null ? ref.get(handler) : void 0; | ||
if (fake == null) { | ||
return this; | ||
} | ||
fakeHandlers[name]["delete"](handler); | ||
parent.process.removeListener(name, fake); | ||
return this; | ||
}, | ||
umask: function() { | ||
if (arguments.length) { | ||
throw new Error("Access denied to set umask."); | ||
} | ||
return parent.process.umask(); | ||
} | ||
@@ -278,0 +342,0 @@ }; |
@@ -7,3 +7,3 @@ { | ||
"name": "vm2", | ||
"description": "vm2 is a sandbox that can run untrusted code with whitelisted built-in node objects. Securely!.", | ||
"description": "vm2 is a sandbox that can run untrusted code with whitelisted built-in node objects. Securely!", | ||
"keywords": [ | ||
@@ -17,3 +17,3 @@ "sandbox", | ||
], | ||
"version": "2.0.0", | ||
"version": "2.0.2", | ||
"main": "index.js", | ||
@@ -20,0 +20,0 @@ "repository": { |
@@ -39,3 +39,3 @@ # vm2 [![Dependency Status](https://david-dm.org/patriksimek/vm2.png)](https://david-dm.org/patriksimek/vm2) [![NPM version](https://badge.fury.io/js/vm2.png)](http://badge.fury.io/js/vm2) [![Build Status](https://secure.travis-ci.org/patriksimek/vm2.png)](http://travis-ci.org/patriksimek/vm2) | ||
* [1.x to 2.x changes](#1-x-to-2-x-changes) | ||
* [1.x to 2.x changes](#1x-to-2x-changes) | ||
* [VM](#vm) | ||
@@ -42,0 +42,0 @@ * [NodeVM](#nodevm) |
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
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
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
118029
2442