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

@webassemblyjs/ast

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webassemblyjs/ast - npm Package Compare versions

Comparing version 1.2.8 to 1.3.0

test/transform/denormalize-type-references/index.js

10

lib/index.js

@@ -518,4 +518,4 @@ "use strict";

return {
valtype: valtype,
id: id
id: id,
valtype: valtype
};

@@ -552,2 +552,8 @@ }

function limits(min, max) {
assert(typeof min === "number");
if (typeof max !== "undefined") {
assert(typeof max === "number");
}
return {

@@ -554,0 +560,0 @@ type: "Limit",

93

lib/traverse.js

@@ -76,2 +76,3 @@ "use strict";

node._deleted = true;
debug("delete path %s", node.type);
} // TODO(sven): do it the good way, changing the node from the parent

@@ -121,3 +122,2 @@

case "LocalNameMetadata":
case "ModuleExport":
case "Data":

@@ -143,9 +143,18 @@ case "Memory":

case "ModuleMetadata":
case "ModuleExport":
{
var _path2 = createPath(n, parentPath);
cb(n.type, createPath(n, _path2));
cb(n.type, _path2);
walk(n.descr.id, cb, _path2);
break;
}
case "ModuleMetadata":
{
var _path3 = createPath(n, parentPath);
cb(n.type, _path3);
n.sections.forEach(function (x) {
return walk(x, cb, _path2);
return walk(x, cb, _path3);
});

@@ -156,3 +165,3 @@

n.functionNames.forEach(function (x) {
return walk(x, cb, _path2);
return walk(x, cb, _path3);
});

@@ -164,3 +173,3 @@ }

n.localNames.forEach(function (x) {
return walk(x, cb, _path2);
return walk(x, cb, _path3);
});

@@ -174,9 +183,9 @@ }

{
var _path3 = createPath(n, parentPath);
var _path4 = createPath(n, parentPath);
cb(n.type, _path3);
cb(n.type, _path4);
if (typeof n.fields !== "undefined") {
n.fields.forEach(function (x) {
return walk(x, cb, _path3);
return walk(x, cb, _path4);
});

@@ -187,3 +196,3 @@ }

// $FlowIgnore
walk(n.metadata, cb, _path3);
walk(n.metadata, cb, _path4);
}

@@ -197,8 +206,8 @@

{
var _path4 = createPath(n, parentPath); // $FlowIgnore
var _path5 = createPath(n, parentPath); // $FlowIgnore
cb(n.type, _path4); // $FlowIgnore
cb(n.type, _path5); // $FlowIgnore
walk(n.index, cb, _path4);
walk(n.index, cb, _path5);
break;

@@ -209,10 +218,10 @@ }

{
var _path5 = createPath(n, parentPath); // $FlowIgnore
var _path6 = createPath(n, parentPath); // $FlowIgnore
cb(n.type, _path5);
cb(n.type, _path6);
if (n.index != null) {
// $FlowIgnore
walk(n.index, cb, _path5);
walk(n.index, cb, _path6);
}

@@ -238,8 +247,8 @@

{
var _path6 = createPath(n, parentPath);
var _path7 = createPath(n, parentPath);
cb(n.type, _path6);
cb(n.type, _path7);
if (n.name != null) {
walk(n.name, cb, _path6);
walk(n.name, cb, _path7);
}

@@ -250,3 +259,3 @@

n.init.forEach(function (x) {
return walk(x, cb, _path6);
return walk(x, cb, _path7);
});

@@ -260,8 +269,8 @@ }

{
var _path7 = createPath(n, parentPath);
var _path8 = createPath(n, parentPath);
cb(n.type, _path7);
cb(n.type, _path8);
if (n.id != null) {
walk(n.id, cb, _path7);
walk(n.id, cb, _path8);
}

@@ -274,20 +283,20 @@

{
var _path8 = createPath(n, parentPath); // $FlowIgnore
var _path9 = createPath(n, parentPath); // $FlowIgnore
cb(n.type, _path8); // $FlowIgnore
cb(n.type, _path9); // $FlowIgnore
n.test.forEach(function (x) {
return walk(x, cb, _path8);
return walk(x, cb, _path9);
}); // $FlowIgnore
n.consequent.forEach(function (x) {
return walk(x, cb, _path8);
return walk(x, cb, _path9);
}); // $FlowIgnore
n.alternate.forEach(function (x) {
return walk(x, cb, _path8);
return walk(x, cb, _path9);
}); // $FlowIgnore
walk(n.testLabel, cb, _path8);
walk(n.testLabel, cb, _path9);
break;

@@ -298,10 +307,10 @@ }

{
var _path9 = createPath(n, parentPath); // $FlowIgnore
var _path10 = createPath(n, parentPath); // $FlowIgnore
cb(n.type, _path9); // $FlowIgnore
cb(n.type, _path10); // $FlowIgnore
if (_typeof(n.args) === "object") {
n.args.forEach(function (x) {
return walk(x, cb, _path9);
return walk(x, cb, _path10);
});

@@ -316,10 +325,10 @@ }

{
var _path10 = createPath(n, parentPath); // $FlowIgnore
var _path11 = createPath(n, parentPath); // $FlowIgnore
cb(n.type, _path10);
cb(n.type, _path11);
if (n.label != null) {
// $FlowIgnore
walk(n.label, cb, _path10);
walk(n.label, cb, _path11);
} // $FlowIgnore

@@ -329,3 +338,3 @@

n.instr.forEach(function (x) {
return walk(x, cb, _path10);
return walk(x, cb, _path11);
});

@@ -337,11 +346,11 @@ break;

{
var _path11 = createPath(n, parentPath);
var _path12 = createPath(n, parentPath);
cb(n.type, _path11);
cb(n.type, _path12);
n.body.forEach(function (x) {
return walk(x, cb, _path11);
return walk(x, cb, _path12);
});
if (n.name != null) {
walk(n.name, cb, _path11);
walk(n.name, cb, _path12);
}

@@ -360,2 +369,6 @@

walk(n, function (type, path) {
if (typeof visitors["Node"] === "function") {
visitors["Node"](path);
}
if (typeof visitors[type] === "function") {

@@ -362,0 +375,0 @@ visitors[type](path);

{
"name": "@webassemblyjs/ast",
"version": "1.2.8",
"version": "1.3.0",
"description": "AST utils for webassemblyjs",

@@ -14,5 +14,5 @@ "keywords": [

"dependencies": {
"@webassemblyjs/helper-wasm-bytecode": "1.2.8",
"@webassemblyjs/wast-parser": "1.2.8",
"webassemblyjs": "1.2.8"
"@webassemblyjs/helper-wasm-bytecode": "1.3.0",
"@webassemblyjs/wast-parser": "1.3.0",
"webassemblyjs": "1.3.0"
},

@@ -19,0 +19,0 @@ "repository": {

@@ -485,4 +485,4 @@ // @flow

return {
valtype,
id
id,
valtype
};

@@ -527,2 +527,8 @@ }

export function limits(min: number, max?: number): Limit {
assert(typeof min === "number");
if (typeof max !== "undefined") {
assert(typeof max === "number");
}
return {

@@ -529,0 +535,0 @@ type: "Limit",

@@ -67,2 +67,4 @@ // @flow

node._deleted = true;
debug("delete path %s", node.type);
}

@@ -108,3 +110,2 @@

case "LocalNameMetadata":
case "ModuleExport":
case "Data":

@@ -129,5 +130,14 @@ case "Memory":

case "ModuleExport": {
const path = createPath(n, parentPath);
cb(n.type, path);
walk(n.descr.id, cb, path);
break;
}
case "ModuleMetadata": {
const path = createPath(n, parentPath);
cb(n.type, createPath(n, path));
cb(n.type, path);
n.sections.forEach(x => walk(x, cb, path));

@@ -302,2 +312,6 @@

(type: string, path: NodePath<Node>) => {
if (typeof visitors["Node"] === "function") {
visitors["Node"](path);
}
if (typeof visitors[type] === "function") {

@@ -304,0 +318,0 @@ visitors[type](path);

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