@webassemblyjs/helper-wasm-section
Advanced tools
Comparing version 1.7.1-0 to 1.7.1
@@ -5,9 +5,5 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
import { overrideBytesInBuffer } from "@webassemblyjs/helper-buffer"; | ||
import constants from "@webassemblyjs/helper-wasm-bytecode"; | ||
import * as t from "@webassemblyjs/ast"; | ||
var t = require("@webassemblyjs/ast"); | ||
var debug = require("debug")("webassemblyjs:wasm:createsection"); | ||
var constants = require("@webassemblyjs/helper-wasm-bytecode"); | ||
function findLastSection(ast, forSection) { | ||
@@ -53,7 +49,5 @@ var targetSectionId = constants.sections[forSection]; // $FlowIgnore: metadata can not be empty | ||
end = start; | ||
debug("create empty section=%s first", section); | ||
} else { | ||
start = lastSection.startOffset + lastSection.size.value + 1; | ||
end = start; | ||
debug("create empty section=%s after=%s start=%d end=%d", section, lastSection.section, start, end); | ||
} // section id | ||
@@ -108,3 +102,2 @@ | ||
t.shiftSection(ast, path.node, deltaBytes); | ||
debug("shift section section=%s detla=%d", path.node.section, deltaBytes); | ||
} | ||
@@ -111,0 +104,0 @@ } |
import { traverse, getSectionMetadata, shiftSection } from "@webassemblyjs/ast"; | ||
import { overrideBytesInBuffer } from "@webassemblyjs/helper-buffer"; | ||
var debug = require("debug")("webassemblyjs:wasm:removesection"); | ||
export function removeSection(ast, uint8Buffer, section) { | ||
@@ -33,3 +30,2 @@ var sectionMetadata = getSectionMetadata(ast, section); | ||
shiftSection(ast, path.node, delta); | ||
debug("shift section section=%s detla=%d", section, delta); | ||
} | ||
@@ -36,0 +32,0 @@ } |
import { encodeU32 } from "@webassemblyjs/wasm-gen"; | ||
import { getSectionMetadata, traverse, shiftSection } from "@webassemblyjs/ast"; | ||
import { overrideBytesInBuffer } from "@webassemblyjs/helper-buffer"; | ||
var debug = require("debug")("webassemblyjs:wasm:resizesection"); | ||
export function resizeSectionByteSize(ast, uint8Buffer, section, deltaBytes) { | ||
@@ -52,7 +49,5 @@ var sectionMetadata = getSectionMetadata(ast, section); | ||
shiftSection(ast, path.node, deltaBytes); | ||
debug("shift section section=%s detla=%d", path.node.section, deltaBytes); | ||
} | ||
} | ||
}); | ||
debug("resize byte size section=%s newValue=%s start=%d end=%d", section, newSectionSize, start, end); | ||
return overrideBytesInBuffer(uint8Buffer, start, end, newBytes); | ||
@@ -84,4 +79,3 @@ } | ||
sectionMetadata.vectorOfSize.loc.end.column = start + newBytes.length; | ||
debug("resize vec size section=%s detla=%d newValue=%s", section, deltaElements, newValue); | ||
return overrideBytesInBuffer(uint8Buffer, start, end, newBytes); | ||
} |
@@ -12,12 +12,14 @@ "use strict"; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
var _helperWasmBytecode = _interopRequireDefault(require("@webassemblyjs/helper-wasm-bytecode")); | ||
var t = require("@webassemblyjs/ast"); | ||
var t = _interopRequireWildcard(require("@webassemblyjs/ast")); | ||
var debug = require("debug")("webassemblyjs:wasm:createsection"); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
var constants = require("@webassemblyjs/helper-wasm-bytecode"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function findLastSection(ast, forSection) { | ||
var targetSectionId = constants.sections[forSection]; // $FlowIgnore: metadata can not be empty | ||
var targetSectionId = _helperWasmBytecode.default.sections[forSection]; // $FlowIgnore: metadata can not be empty | ||
@@ -35,3 +37,3 @@ var moduleSections = ast.body[0].metadata.sections; | ||
var sectionId = constants.sections[section.section]; | ||
var sectionId = _helperWasmBytecode.default.sections[section.section]; | ||
@@ -62,7 +64,5 @@ if (targetSectionId > lastId && targetSectionId < sectionId) { | ||
end = start; | ||
debug("create empty section=%s first", section); | ||
} else { | ||
start = lastSection.startOffset + lastSection.size.value + 1; | ||
end = start; | ||
debug("create empty section=%s after=%s start=%d end=%d", section, lastSection.section, start, end); | ||
} // section id | ||
@@ -117,3 +117,2 @@ | ||
t.shiftSection(ast, path.node, deltaBytes); | ||
debug("shift section section=%s detla=%d", path.node.section, deltaBytes); | ||
} | ||
@@ -120,0 +119,0 @@ } |
@@ -12,4 +12,2 @@ "use strict"; | ||
var debug = require("debug")("webassemblyjs:wasm:removesection"); | ||
function removeSection(ast, uint8Buffer, section) { | ||
@@ -42,3 +40,2 @@ var sectionMetadata = (0, _ast.getSectionMetadata)(ast, section); | ||
(0, _ast.shiftSection)(ast, path.node, delta); | ||
debug("shift section section=%s detla=%d", section, delta); | ||
} | ||
@@ -45,0 +42,0 @@ } |
@@ -15,4 +15,2 @@ "use strict"; | ||
var debug = require("debug")("webassemblyjs:wasm:resizesection"); | ||
function resizeSectionByteSize(ast, uint8Buffer, section, deltaBytes) { | ||
@@ -63,7 +61,5 @@ var sectionMetadata = (0, _ast.getSectionMetadata)(ast, section); | ||
(0, _ast.shiftSection)(ast, path.node, deltaBytes); | ||
debug("shift section section=%s detla=%d", path.node.section, deltaBytes); | ||
} | ||
} | ||
}); | ||
debug("resize byte size section=%s newValue=%s start=%d end=%d", section, newSectionSize, start, end); | ||
return (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newBytes); | ||
@@ -96,4 +92,3 @@ } | ||
sectionMetadata.vectorOfSize.loc.end.column = start + newBytes.length; | ||
debug("resize vec size section=%s detla=%d newValue=%s", section, deltaElements, newValue); | ||
return (0, _helperBuffer.overrideBytesInBuffer)(uint8Buffer, start, end, newBytes); | ||
} |
{ | ||
"name": "@webassemblyjs/helper-wasm-section", | ||
"version": "1.7.1-0", | ||
"version": "1.7.1", | ||
"description": "", | ||
@@ -20,11 +20,10 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@webassemblyjs/ast": "1.7.1-0", | ||
"@webassemblyjs/helper-buffer": "1.7.1-0", | ||
"@webassemblyjs/helper-wasm-bytecode": "1.7.1-0", | ||
"@webassemblyjs/wasm-gen": "1.7.1-0", | ||
"debug": "^3.1.0" | ||
"@webassemblyjs/ast": "1.7.1", | ||
"@webassemblyjs/helper-buffer": "1.7.1", | ||
"@webassemblyjs/helper-wasm-bytecode": "1.7.1", | ||
"@webassemblyjs/wasm-gen": "1.7.1" | ||
}, | ||
"devDependencies": { | ||
"@webassemblyjs/wasm-parser": "1.7.1-0" | ||
"@webassemblyjs/wasm-parser": "1.7.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4
2
17564
407
+ Added@webassemblyjs/ast@1.7.1(transitive)
+ Added@webassemblyjs/floating-point-hex-parser@1.7.1(transitive)
+ Added@webassemblyjs/helper-api-error@1.7.1(transitive)
+ Added@webassemblyjs/helper-buffer@1.7.1(transitive)
+ Added@webassemblyjs/helper-code-frame@1.7.1(transitive)
+ Added@webassemblyjs/helper-fsm@1.7.1(transitive)
+ Added@webassemblyjs/helper-module-context@1.7.1(transitive)
+ Added@webassemblyjs/helper-wasm-bytecode@1.7.1(transitive)
+ Added@webassemblyjs/ieee754@1.7.1(transitive)
+ Added@webassemblyjs/leb128@1.7.1(transitive)
+ Added@webassemblyjs/utf8@1.7.1(transitive)
+ Added@webassemblyjs/wasm-gen@1.7.1(transitive)
+ Added@webassemblyjs/wast-parser@1.7.1(transitive)
+ Added@webassemblyjs/wast-printer@1.7.1(transitive)
+ Added@xtuc/ieee754@1.2.0(transitive)
+ Added@xtuc/long@4.2.1(transitive)
- Removeddebug@^3.1.0
- Removed@webassemblyjs/ast@1.7.1-0(transitive)
- Removed@webassemblyjs/floating-point-hex-parser@1.7.1-0(transitive)
- Removed@webassemblyjs/helper-api-error@1.7.1-0(transitive)
- Removed@webassemblyjs/helper-buffer@1.7.1-0(transitive)
- Removed@webassemblyjs/helper-code-frame@1.7.1-0(transitive)
- Removed@webassemblyjs/helper-fsm@1.7.1-0(transitive)
- Removed@webassemblyjs/helper-module-context@1.7.1-0(transitive)
- Removed@webassemblyjs/helper-wasm-bytecode@1.7.1-0(transitive)
- Removed@webassemblyjs/ieee754@1.7.1-0(transitive)
- Removed@webassemblyjs/leb128@1.7.1-0(transitive)
- Removed@webassemblyjs/utf8@1.7.1-0(transitive)
- Removed@webassemblyjs/wasm-gen@1.7.1-0(transitive)
- Removed@webassemblyjs/wast-parser@1.7.1-0(transitive)
- Removed@webassemblyjs/wast-printer@1.7.1-0(transitive)
- Removeddebug@3.2.7(transitive)
- Removedieee754@1.2.1(transitive)
- Removedlong@3.2.04.0.0(transitive)
- Removedms@2.1.3(transitive)
Updated@webassemblyjs/ast@1.7.1