| | |
| | | const RuntimeGlobals = require("../RuntimeGlobals"); |
| | | const formatLocation = require("../formatLocation"); |
| | | const { evaluateToString } = require("../javascript/JavascriptParserHelpers"); |
| | | const propertyAccess = require("../util/propertyAccess"); |
| | | const { propertyAccess } = require("../util/property"); |
| | | const CommonJsExportRequireDependency = require("./CommonJsExportRequireDependency"); |
| | | const CommonJsExportsDependency = require("./CommonJsExportsDependency"); |
| | | const CommonJsSelfReferenceDependency = require("./CommonJsSelfReferenceDependency"); |
| | |
| | | }; |
| | | |
| | | /** |
| | | * Parses require call. |
| | | * @param {JavascriptParser} parser the parser |
| | | * @param {Expression} expr expression |
| | | * @returns {{ argument: BasicEvaluatedExpression, ids: ExportInfoName[] } | undefined} parsed call |
| | |
| | | |
| | | class CommonJsExportsParserPlugin { |
| | | /** |
| | | * Creates an instance of CommonJsExportsParserPlugin. |
| | | * @param {ModuleGraph} moduleGraph module graph |
| | | */ |
| | | constructor(moduleGraph) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Applies the plugin by registering its hooks on the compiler. |
| | | * @param {JavascriptParser} parser the parser |
| | | * @returns {void} |
| | | */ |
| | |
| | | }; |
| | | |
| | | /** |
| | | * Checks namespace. |
| | | * @param {boolean} topLevel true, when the export is on top level |
| | | * @param {Members} members members of the export |
| | | * @param {Expression | undefined} valueExpr expression for the value |
| | |
| | | } |
| | | }; |
| | | /** |
| | | * Processes the provided reason. |
| | | * @param {string=} reason reason |
| | | */ |
| | | const bailout = (reason) => { |
| | |
| | | if (reason) bailoutHint(reason); |
| | | }; |
| | | /** |
| | | * Processes the provided reason. |
| | | * @param {string} reason reason |
| | | */ |
| | | const bailoutHint = (reason) => { |
| | |
| | | // exporting // |
| | | |
| | | /** |
| | | * Handle assign export. |
| | | * @param {AssignmentExpression} expr expression |
| | | * @param {CommonJSDependencyBaseKeywords} base commonjs base keywords |
| | | * @param {Members} members members of the export |
| | |
| | | // Self reference // |
| | | |
| | | /** |
| | | * Handle access export. |
| | | * @param {Expression | Super} expr expression |
| | | * @param {CommonJSDependencyBaseKeywords} base commonjs base keywords |
| | | * @param {Members} members members of the export |