Socket
Socket
Sign inDemoInstall

infuse

Package Overview
Dependencies
7
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.19 to 0.0.20

15

lib/util-ast.js

@@ -23,4 +23,5 @@

keysMap = AST_NAME_KEYS,
__tmpFn__
;
ctx = VM.createContext({
__tmpFn__: null
});

@@ -108,3 +109,3 @@ function spliceNode (node, start, end /*rest...*/) {

case keysMap.array:
return ast[1].map(function (v) { return valueToAst(v); });
return ast[1].map(function (v) { return astToValue(v); });
case keysMap["function"]:

@@ -115,6 +116,8 @@ case "function":

fnBody = jsb.gen_code(["toplevel", ast[3]], beautifully);
fn = VM.runInThisContext("__tmpFn__ = function " + (fnName ? fnName : "") +
"(" + fnArgs.join(", ") + ") {" + fnBody + "}"
VM.runInContext(
"__tmpFn__ = function " + (fnName ? fnName : "") +
"(" + fnArgs.join(", ") + ") {" + fnBody + "}",
ctx
);
return fn;
return ctx.__tmpFn__;
}

@@ -121,0 +124,0 @@ }

2

package.json
{
"name": "infuse",
"description": "Mainline your node JavaScript for universal consumption.",
"version": "0.0.19",
"version": "0.0.20",
"keywords": [

@@ -6,0 +6,0 @@ "javascript",

@@ -20,7 +20,8 @@ /*globals suite, test, setup, teardown */

ast = astUtil.valueToAst(list),
iter = new Iterator(ast)
iter = new Iterator(ast),
val
;
// console.log(SysUtil.inspect(ast, false, 100));
iter.getCurrent().name.should.equal("array");

@@ -44,2 +45,7 @@ iter.next();

val = astUtil.astToValue(ast);
val[0].should.equal('a');
val[1].should.equal(1);
val[2].foo.should.equal('foo');
});

@@ -55,8 +61,11 @@

ast = astUtil.valueToAst(obj),
iter = new Iterator(ast)
iter = new Iterator(ast),
val = astUtil.astToValue(ast)
;
// console.log(SysUtil.inspect(ast, false, 100));
val.list.should.eql(['A', 2, 'c', 4]);
(typeof val.foo).should.equal('function');
val.foo().should.equal('foo');
});
});
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc