source: frontend/node_modules/@babel/eslint-parser/lib/worker/maybeParse.cjs

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago

Fix frontend appearance

  • Property mode set to 100644
File size: 2.0 KB
Line 
1"use strict";
2
3function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
4function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
5const babel = require("./babel-core.cjs");
6const convert = require("../convert/index.cjs");
7const astInfo = require("./ast-info.cjs");
8const extractParserOptionsPlugin = require("./extract-parser-options-plugin.cjs");
9const {
10 getVisitorKeys,
11 getTokLabels
12} = astInfo;
13const ref = {};
14let extractParserOptionsConfigItem;
15const MULTIPLE_OVERRIDES = /More than one plugin attempted to override parsing/;
16module.exports = function () {
17 var _asyncMaybeParse = _asyncToGenerator(function* (code, options) {
18 if (!extractParserOptionsConfigItem) {
19 extractParserOptionsConfigItem = yield babel.createConfigItemAsync([extractParserOptionsPlugin, ref], {
20 dirname: __dirname,
21 type: "plugin"
22 });
23 }
24 const {
25 plugins
26 } = options;
27 options.plugins = plugins.concat(extractParserOptionsConfigItem);
28 let ast;
29 try {
30 return {
31 parserOptions: yield babel.parseAsync(code, options),
32 ast: null
33 };
34 } catch (err) {
35 if (!MULTIPLE_OVERRIDES.test(err.message)) {
36 throw err;
37 }
38 }
39 options.plugins = plugins;
40 try {
41 ast = yield babel.parseAsync(code, options);
42 } catch (err) {
43 throw convert.convertError(err);
44 }
45 return {
46 ast: convert.convertFile(ast, code, getTokLabels(), getVisitorKeys()),
47 parserOptions: null
48 };
49 });
50 function asyncMaybeParse(_x, _x2) {
51 return _asyncMaybeParse.apply(this, arguments);
52 }
53 return asyncMaybeParse;
54}();
55
56//# sourceMappingURL=maybeParse.cjs.map
Note: See TracBrowser for help on using the repository browser.