source: trip-planner-front/node_modules/@webassemblyjs/wasm-opt/esm/index.js@ 76712b2

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

initial commit

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