source: trip-planner-front/node_modules/@webassemblyjs/wasm-opt/lib/index.js@ fa375fe

Last change on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.2 KB
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.shrinkPaddedLEB128 = shrinkPaddedLEB128;
7
8var _wasmParser = require("@webassemblyjs/wasm-parser");
9
10var _leb = require("./leb128.js");
11
12function _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); }
13
14function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
16function _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; }
17
18function _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; }
19
20var OptimizerError =
21/*#__PURE__*/
22function (_Error) {
23 _inherits(OptimizerError, _Error);
24
25 function OptimizerError(name, initalError) {
26 var _this;
27
28 _classCallCheck(this, OptimizerError);
29
30 _this = _possibleConstructorReturn(this, (OptimizerError.__proto__ || Object.getPrototypeOf(OptimizerError)).call(this, "Error while optimizing: " + name + ": " + initalError.message));
31 _this.stack = initalError.stack;
32 return _this;
33 }
34
35 return OptimizerError;
36}(Error);
37
38var decoderOpts = {
39 ignoreCodeSection: true,
40 ignoreDataSection: true
41};
42
43function shrinkPaddedLEB128(uint8Buffer) {
44 try {
45 var ast = (0, _wasmParser.decode)(uint8Buffer.buffer, decoderOpts);
46 return (0, _leb.shrinkPaddedLEB128)(ast, uint8Buffer);
47 } catch (e) {
48 throw new OptimizerError("shrinkPaddedLEB128", e);
49 }
50}
Note: See TracBrowser for help on using the repository browser.