Socket
Socket
Sign inDemoInstall

contextify

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contextify - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

changelog

2

package.json

@@ -9,3 +9,3 @@ {

],
"version": "0.0.6",
"version": "0.0.7",
"repository": {

@@ -12,0 +12,0 @@ "type" : "git",

@@ -42,2 +42,12 @@ var Contextify = require('../lib/contextify.js');

'sandbox prototype properties should be searched' : function (test) {
var sandbox = {};
sandbox.__proto__ = {
prop1 : 'test'
};
Contextify(sandbox);
test.equal(sandbox.getGlobal().prop1, 'test');
test.done();
},
// Make sure properties that aren't there...aren't there.

@@ -50,2 +60,26 @@ 'test for nonexistent properties' : function (test) {

// Make sure properties with value "undefined" are there.
'test for "undefined" properties' : function (test) {
var sandbox = { x: undefined };
Contextify(sandbox);
sandbox.run("_x = x");
test.equal(sandbox._x, undefined);
test.done();
},
'test for "undefined" variables' : function (test) {
var sandbox = { };
Contextify(sandbox);
// In JavaScript a declared variable is set to 'undefined'.
sandbox.run("var y; (function() { var _y ; y = _y })()");
test.equal(sandbox._y, undefined);
// This should apply to top-level variables (global properties).
sandbox.run("var z; _z = z");
test.equal(sandbox._z, undefined);
// Make sure nothing wacky happens when accessing global declared but
// undefined variables.
test.equal(sandbox.getGlobal().z, undefined);
test.done();
},
// Make sure run can be called with a filename parameter.

@@ -52,0 +86,0 @@ 'test run with filename' : function (test) {

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