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

@webassemblyjs/wasm-edit

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webassemblyjs/wasm-edit - npm Package Compare versions

Comparing version 1.7.0-0 to 1.7.0-1

6

esm/apply.js

@@ -12,4 +12,2 @@ function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

var debug = require("debug")("webassemblyjs:wasm");
function shiftLocNodeByDelta(node, delta) {

@@ -60,4 +58,3 @@ assertHasLoc(node); // $FlowIgnore: assertHasLoc ensures that

var newValue = node.metadata.bodySize + bodySizeDeltaBytes;
var newByteArray = encodeU32(newValue);
debug("resize func body newValue=%d", newValue); // function body size byte
var newByteArray = encodeU32(newValue); // function body size byte
// FIXME(sven): only handles one byte u32

@@ -174,3 +171,2 @@

var deltaBytes = newByteArray.length;
debug("add node=%s section=%s after=%d deltaBytes=%s deltaElements=%s", node.type, sectionName, start, deltaBytes, deltaElements);
uint8Buffer = overrideBytesInBuffer(uint8Buffer, start, end, newByteArray);

@@ -177,0 +173,0 @@ node.loc = {

4

esm/index.js

@@ -5,3 +5,5 @@ import { decode } from "@webassemblyjs/wasm-parser";

import { shrinkPaddedLEB128 } from "@webassemblyjs/wasm-opt";
import constants from "@webassemblyjs/helper-wasm-bytecode";
var constants = require("@webassemblyjs/helper-wasm-bytecode");
import { applyOperations } from "./apply";

@@ -8,0 +10,0 @@

@@ -24,4 +24,2 @@ "use strict";

var debug = require("debug")("webassemblyjs:wasm");
function shiftLocNodeByDelta(node, delta) {

@@ -72,4 +70,3 @@ (0, _ast.assertHasLoc)(node); // $FlowIgnore: assertHasLoc ensures that

var newValue = node.metadata.bodySize + bodySizeDeltaBytes;
var newByteArray = (0, _encoder.encodeU32)(newValue);
debug("resize func body newValue=%d", newValue); // function body size byte
var newByteArray = (0, _encoder.encodeU32)(newValue); // function body size byte
// FIXME(sven): only handles one byte u32

@@ -186,3 +183,2 @@

var deltaBytes = newByteArray.length;
debug("add node=%s section=%s after=%d deltaBytes=%s deltaElements=%s", node.type, sectionName, start, deltaBytes, deltaElements);
uint8Buffer = (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newByteArray);

@@ -189,0 +185,0 @@ node.loc = {

@@ -19,7 +19,5 @@ "use strict";

var _helperWasmBytecode = _interopRequireDefault(require("@webassemblyjs/helper-wasm-bytecode"));
var _apply = require("./apply");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var constants = require("@webassemblyjs/helper-wasm-bytecode");

@@ -37,9 +35,7 @@ function hashNode(node) {

nodes.sort(function (a, b) {
var sectionA = _helperWasmBytecode.default.getSectionForNode(a);
var sectionA = constants.getSectionForNode(a);
var sectionB = constants.getSectionForNode(b);
var aId = constants.sections[sectionA];
var bId = constants.sections[sectionB];
var sectionB = _helperWasmBytecode.default.getSectionForNode(b);
var aId = _helperWasmBytecode.default.sections[sectionA];
var bId = _helperWasmBytecode.default.sections[sectionB];
if (typeof aId !== "number" || typeof bId !== "number") {

@@ -46,0 +42,0 @@ throw new Error("Section id not found");

{
"name": "@webassemblyjs/wasm-edit",
"version": "1.7.0-0",
"version": "1.7.0-1",
"description": "",

@@ -20,15 +20,14 @@ "main": "lib/index.js",

"dependencies": {
"@webassemblyjs/ast": "1.7.0-0",
"@webassemblyjs/helper-buffer": "1.7.0-0",
"@webassemblyjs/helper-wasm-bytecode": "1.7.0-0",
"@webassemblyjs/helper-wasm-section": "1.7.0-0",
"@webassemblyjs/wasm-gen": "1.7.0-0",
"@webassemblyjs/wasm-opt": "1.7.0-0",
"@webassemblyjs/wasm-parser": "1.7.0-0",
"@webassemblyjs/wast-printer": "1.7.0-0",
"debug": "^3.1.0"
"@webassemblyjs/ast": "1.7.0-1",
"@webassemblyjs/helper-buffer": "1.7.0-1",
"@webassemblyjs/helper-wasm-bytecode": "1.7.0-1",
"@webassemblyjs/helper-wasm-section": "1.7.0-1",
"@webassemblyjs/wasm-gen": "1.7.0-1",
"@webassemblyjs/wasm-opt": "1.7.0-1",
"@webassemblyjs/wasm-parser": "1.7.0-1",
"@webassemblyjs/wast-printer": "1.7.0-1"
},
"devDependencies": {
"@webassemblyjs/helper-test-framework": "1.7.0-0"
"@webassemblyjs/helper-test-framework": "1.7.0-1"
}
}
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