From 81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 Mon Sep 17 00:00:00 2001 From: Piotr Russ Date: Wed, 18 Nov 2020 23:26:45 +0100 Subject: rm node_modules --- node_modules/@webassemblyjs/wasm-opt/esm/index.js | 41 ------------------- node_modules/@webassemblyjs/wasm-opt/esm/leb128.js | 47 ---------------------- 2 files changed, 88 deletions(-) delete mode 100644 node_modules/@webassemblyjs/wasm-opt/esm/index.js delete mode 100644 node_modules/@webassemblyjs/wasm-opt/esm/leb128.js (limited to 'node_modules/@webassemblyjs/wasm-opt/esm') diff --git a/node_modules/@webassemblyjs/wasm-opt/esm/index.js b/node_modules/@webassemblyjs/wasm-opt/esm/index.js deleted file mode 100644 index f9d9232..0000000 --- a/node_modules/@webassemblyjs/wasm-opt/esm/index.js +++ /dev/null @@ -1,41 +0,0 @@ -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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -import { decode } from "@webassemblyjs/wasm-parser"; -import { shrinkPaddedLEB128 as makeShrinkPaddedLEB128 } from "./leb128.js"; - -var OptimizerError = -/*#__PURE__*/ -function (_Error) { - _inherits(OptimizerError, _Error); - - function OptimizerError(name, initalError) { - var _this; - - _classCallCheck(this, OptimizerError); - - _this = _possibleConstructorReturn(this, (OptimizerError.__proto__ || Object.getPrototypeOf(OptimizerError)).call(this, "Error while optimizing: " + name + ": " + initalError.message)); - _this.stack = initalError.stack; - return _this; - } - - return OptimizerError; -}(Error); - -var decoderOpts = { - ignoreCodeSection: true, - ignoreDataSection: true -}; -export function shrinkPaddedLEB128(uint8Buffer) { - try { - var ast = decode(uint8Buffer.buffer, decoderOpts); - return makeShrinkPaddedLEB128(ast, uint8Buffer); - } catch (e) { - throw new OptimizerError("shrinkPaddedLEB128", e); - } -} \ No newline at end of file diff --git a/node_modules/@webassemblyjs/wasm-opt/esm/leb128.js b/node_modules/@webassemblyjs/wasm-opt/esm/leb128.js deleted file mode 100644 index 3150c9e..0000000 --- a/node_modules/@webassemblyjs/wasm-opt/esm/leb128.js +++ /dev/null @@ -1,47 +0,0 @@ -import { traverse, shiftSection } from "@webassemblyjs/ast"; -import { encodeU32 } from "@webassemblyjs/wasm-gen/lib/encoder"; -import { overrideBytesInBuffer } from "@webassemblyjs/helper-buffer"; - -function shiftFollowingSections(ast, _ref, deltaInSizeEncoding) { - var section = _ref.section; - // Once we hit our section every that is after needs to be shifted by the delta - var encounteredSection = false; - traverse(ast, { - SectionMetadata: function SectionMetadata(path) { - if (path.node.section === section) { - encounteredSection = true; - return; - } - - if (encounteredSection === true) { - shiftSection(ast, path.node, deltaInSizeEncoding); - } - } - }); -} - -export function shrinkPaddedLEB128(ast, uint8Buffer) { - traverse(ast, { - SectionMetadata: function SectionMetadata(_ref2) { - var node = _ref2.node; - - /** - * Section size - */ - { - var newu32Encoded = encodeU32(node.size.value); - var newu32EncodedLen = newu32Encoded.length; - var start = node.size.loc.start.column; - var end = node.size.loc.end.column; - var oldu32EncodedLen = end - start; - - if (newu32EncodedLen !== oldu32EncodedLen) { - var deltaInSizeEncoding = oldu32EncodedLen - newu32EncodedLen; - uint8Buffer = overrideBytesInBuffer(uint8Buffer, start, end, newu32Encoded); - shiftFollowingSections(ast, node, -deltaInSizeEncoding); - } - } - } - }); - return uint8Buffer; -} \ No newline at end of file -- cgit v1.2.3