Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

spoon

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spoon - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

20

lib/spoon/cfg.js

@@ -122,9 +122,21 @@ var cfg = exports,

block.predecessors.forEach(function(pred) {
// Remove goto
var last = pred.instructions.pop();
if (pred.successors.length < 2) {
pred.successors = [];
pred.ended = false;
// Remove goto
var last = pred.instructions.pop();
pred.ended = false;
} else {
// Replace one of the branches
var index = pred.successors[0] === block ? 0 : 1,
tmp = this.createBlock();
pred.successors[index] = tmp;
tmp.addPredecessor(pred);
pred = tmp;
}
pred.add('async-goto', [ pred.add('get', [ info.fn.name ]) ]);
pred.end();
pred.successors = [];
}, this);

@@ -131,0 +143,0 @@ block.predecessors = [];

6

package.json
{
"name": "spoon",
"version": "0.1.3",
"version": "0.1.4",
"main": "lib/spoon",
"dependencies": {
"esprima": "~0.9.9",
"esprima": "~1.0.2",
"uglify-js": "~1.3.3",
"escodegen": "0.0.9"
"escodegen": "~0.0.15"
},

@@ -10,0 +10,0 @@ "devDependencies": {

@@ -22,2 +22,3 @@ var spoon = require('..'),

once = false;
console.log(cfg.toString());
vm.runInNewContext(code + ';\nfn(callback)', {

@@ -144,2 +145,35 @@ callback: function(err, r) {

it('should asyncify call in while loop', function() {
var r = test(function fn(__$callback) {
"enable spoon";
function async(a, b, callback) {
callback(null, a + b);
}
var x = 0,
p = false,
i;
if (p) {
i = 11;
while (i) {
i--;
x = async(i, x);
}
}
if (!p) {
i = 11;
while (i) {
i--;
x = async(i, x);
}
}
return x + 1;
});
r = assert.equal(r, 56);
});
it('should asyncify call in do while loop', function() {

@@ -146,0 +180,0 @@ var r = test(function fn(__$callback) {

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