source: imaps-frontend/node_modules/rollup/dist/shared/parseAst.js@ 0c6b92a

main
Last change on this file since 0c6b92a was 0c6b92a, checked in by stefan toskovski <stefantoska84@…>, 5 weeks ago

Pred finalna verzija

  • Property mode set to 100644
File size: 89.8 KB
Line 
1/*
2 @license
3 Rollup.js v4.27.4
4 Sat, 23 Nov 2024 06:59:50 GMT - commit e805b546405a4e6cfccd3fe73e9f4df770023824
5
6 https://github.com/rollup/rollup
7
8 Released under the MIT License.
9*/
10'use strict';
11
12const native_js = require('../native.js');
13const path = require('node:path');
14
15/** @typedef {import('./types').Location} Location */
16
17/**
18 * @param {import('./types').Range} range
19 * @param {number} index
20 */
21function rangeContains(range, index) {
22 return range.start <= index && index < range.end;
23}
24
25/**
26 * @param {string} source
27 * @param {import('./types').Options} [options]
28 */
29function getLocator(source, options = {}) {
30 const { offsetLine = 0, offsetColumn = 0 } = options;
31
32 let start = 0;
33 const ranges = source.split('\n').map((line, i) => {
34 const end = start + line.length + 1;
35
36 /** @type {import('./types').Range} */
37 const range = { start, end, line: i };
38
39 start = end;
40 return range;
41 });
42
43 let i = 0;
44
45 /**
46 * @param {string | number} search
47 * @param {number} [index]
48 * @returns {Location | undefined}
49 */
50 function locator(search, index) {
51 if (typeof search === 'string') {
52 search = source.indexOf(search, index ?? 0);
53 }
54
55 if (search === -1) return undefined;
56
57 let range = ranges[i];
58
59 const d = search >= range.end ? 1 : -1;
60
61 while (range) {
62 if (rangeContains(range, search)) {
63 return {
64 line: offsetLine + range.line,
65 column: offsetColumn + search - range.start,
66 character: search
67 };
68 }
69
70 i += d;
71 range = ranges[i];
72 }
73 }
74
75 return locator;
76}
77
78/**
79 * @param {string} source
80 * @param {string | number} search
81 * @param {import('./types').Options} [options]
82 * @returns {Location | undefined}
83 */
84function locate(source, search, options) {
85 return getLocator(source, options)(search, options && options.startIndex);
86}
87
88function spaces(index) {
89 let result = '';
90 while (index--)
91 result += ' ';
92 return result;
93}
94function tabsToSpaces(value) {
95 return value.replace(/^\t+/, match => match.split('\t').join(' '));
96}
97const LINE_TRUNCATE_LENGTH = 120;
98const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
99const ELLIPSIS = '...';
100function getCodeFrame(source, line, column) {
101 let lines = source.split('\n');
102 // Needed if a plugin did not generate correct sourcemaps
103 if (line > lines.length)
104 return '';
105 const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length +
106 MIN_CHARACTERS_SHOWN_AFTER_LOCATION +
107 ELLIPSIS.length, LINE_TRUNCATE_LENGTH);
108 const frameStart = Math.max(0, line - 3);
109 let frameEnd = Math.min(line + 2, lines.length);
110 lines = lines.slice(frameStart, frameEnd);
111 while (!/\S/.test(lines[lines.length - 1])) {
112 lines.pop();
113 frameEnd -= 1;
114 }
115 const digits = String(frameEnd).length;
116 return lines
117 .map((sourceLine, index) => {
118 const isErrorLine = frameStart + index + 1 === line;
119 let lineNumber = String(index + frameStart + 1);
120 while (lineNumber.length < digits)
121 lineNumber = ` ${lineNumber}`;
122 let displayedLine = tabsToSpaces(sourceLine);
123 if (displayedLine.length > maxLineLength) {
124 displayedLine = `${displayedLine.slice(0, maxLineLength - ELLIPSIS.length)}${ELLIPSIS}`;
125 }
126 if (isErrorLine) {
127 const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + '^';
128 return `${lineNumber}: ${displayedLine}\n${indicator}`;
129 }
130 return `${lineNumber}: ${displayedLine}`;
131 })
132 .join('\n');
133}
134
135const LOGLEVEL_SILENT = 'silent';
136const LOGLEVEL_ERROR = 'error';
137const LOGLEVEL_WARN = 'warn';
138const LOGLEVEL_INFO = 'info';
139const LOGLEVEL_DEBUG = 'debug';
140const logLevelPriority = {
141 [LOGLEVEL_DEBUG]: 0,
142 [LOGLEVEL_INFO]: 1,
143 [LOGLEVEL_SILENT]: 3,
144 [LOGLEVEL_WARN]: 2
145};
146
147const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Za-z]:)?[/\\|])/;
148const RELATIVE_PATH_REGEX = /^\.?\.(\/|$)/;
149function isAbsolute(path) {
150 return ABSOLUTE_PATH_REGEX.test(path);
151}
152function isRelative(path) {
153 return RELATIVE_PATH_REGEX.test(path);
154}
155const BACKSLASH_REGEX = /\\/g;
156function normalize(path) {
157 return path.replace(BACKSLASH_REGEX, '/');
158}
159
160function printQuotedStringList(list, verbs) {
161 const isSingleItem = list.length <= 1;
162 const quotedList = list.map(item => `"${item}"`);
163 let output = isSingleItem
164 ? quotedList[0]
165 : `${quotedList.slice(0, -1).join(', ')} and ${quotedList.slice(-1)[0]}`;
166 if (verbs) {
167 output += ` ${isSingleItem ? verbs[0] : verbs[1]}`;
168 }
169 return output;
170}
171
172const ANY_SLASH_REGEX = /[/\\]/;
173function relative(from, to) {
174 const fromParts = from.split(ANY_SLASH_REGEX).filter(Boolean);
175 const toParts = to.split(ANY_SLASH_REGEX).filter(Boolean);
176 if (fromParts[0] === '.')
177 fromParts.shift();
178 if (toParts[0] === '.')
179 toParts.shift();
180 while (fromParts[0] && toParts[0] && fromParts[0] === toParts[0]) {
181 fromParts.shift();
182 toParts.shift();
183 }
184 while (toParts[0] === '..' && fromParts.length > 0) {
185 toParts.shift();
186 fromParts.pop();
187 }
188 while (fromParts.pop()) {
189 toParts.unshift('..');
190 }
191 return toParts.join('/');
192}
193
194function getAliasName(id) {
195 const base = path.basename(id);
196 return base.slice(0, Math.max(0, base.length - path.extname(id).length));
197}
198function relativeId(id) {
199 if (!isAbsolute(id))
200 return id;
201 return relative(path.resolve(), id);
202}
203function isPathFragment(name) {
204 // starting with "/", "./", "../", "C:/"
205 return (name[0] === '/' || (name[0] === '.' && (name[1] === '/' || name[1] === '.')) || isAbsolute(name));
206}
207const UPPER_DIR_REGEX = /^(\.\.\/)*\.\.$/;
208function getImportPath(importerId, targetPath, stripJsExtension, ensureFileName) {
209 while (targetPath.startsWith('../')) {
210 targetPath = targetPath.slice(3);
211 importerId = '_/' + importerId;
212 }
213 let relativePath = normalize(relative(path.dirname(importerId), targetPath));
214 if (stripJsExtension && relativePath.endsWith('.js')) {
215 relativePath = relativePath.slice(0, -3);
216 }
217 if (ensureFileName) {
218 if (relativePath === '')
219 return '../' + path.basename(targetPath);
220 if (UPPER_DIR_REGEX.test(relativePath)) {
221 return [...relativePath.split('/'), '..', path.basename(targetPath)].join('/');
222 }
223 }
224 return relativePath ? (relativePath.startsWith('..') ? relativePath : './' + relativePath) : '.';
225}
226
227function isValidUrl(url) {
228 try {
229 new URL(url);
230 }
231 catch {
232 return false;
233 }
234 return true;
235}
236function getRollupUrl(snippet) {
237 return `https://rollupjs.org/${snippet}`;
238}
239function addTrailingSlashIfMissed(url) {
240 if (!url.endsWith('/')) {
241 return url + '/';
242 }
243 return url;
244}
245
246// troubleshooting
247const URL_AVOIDING_EVAL = 'troubleshooting/#avoiding-eval';
248const URL_NAME_IS_NOT_EXPORTED = 'troubleshooting/#error-name-is-not-exported-by-module';
249const URL_THIS_IS_UNDEFINED = 'troubleshooting/#error-this-is-undefined';
250const URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY = 'troubleshooting/#warning-treating-module-as-external-dependency';
251const URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT = 'troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect';
252// configuration-options
253const URL_JSX = 'configuration-options/#jsx';
254const URL_OUTPUT_AMD_ID = 'configuration-options/#output-amd-id';
255const URL_OUTPUT_AMD_BASEPATH = 'configuration-options/#output-amd-basepath';
256const URL_OUTPUT_DIR = 'configuration-options/#output-dir';
257const URL_OUTPUT_EXPORTS = 'configuration-options/#output-exports';
258const URL_OUTPUT_EXTEND = 'configuration-options/#output-extend';
259const URL_OUTPUT_EXTERNALIMPORTATTRIBUTES = 'configuration-options/#output-externalimportattributes';
260const URL_OUTPUT_FORMAT = 'configuration-options/#output-format';
261const URL_OUTPUT_GENERATEDCODE = 'configuration-options/#output-generatedcode';
262const URL_OUTPUT_GLOBALS = 'configuration-options/#output-globals';
263const URL_OUTPUT_INLINEDYNAMICIMPORTS = 'configuration-options/#output-inlinedynamicimports';
264const URL_OUTPUT_INTEROP = 'configuration-options/#output-interop';
265const URL_OUTPUT_MANUALCHUNKS = 'configuration-options/#output-manualchunks';
266const URL_OUTPUT_NAME = 'configuration-options/#output-name';
267const URL_OUTPUT_SOURCEMAPBASEURL = 'configuration-options/#output-sourcemapbaseurl';
268const URL_OUTPUT_SOURCEMAPFILE = 'configuration-options/#output-sourcemapfile';
269const URL_PRESERVEENTRYSIGNATURES = 'configuration-options/#preserveentrysignatures';
270const URL_TREESHAKE = 'configuration-options/#treeshake';
271const URL_TREESHAKE_PURE = 'configuration-options/#pure';
272const URL_TREESHAKE_NOSIDEEFFECTS = 'configuration-options/#no-side-effects';
273const URL_TREESHAKE_MODULESIDEEFFECTS = 'configuration-options/#treeshake-modulesideeffects';
274const URL_WATCH = 'configuration-options/#watch';
275// command-line-interface
276const URL_BUNDLE_CONFIG_AS_CJS = 'command-line-interface/#bundleconfigascjs';
277const URL_CONFIGURATION_FILES = 'command-line-interface/#configuration-files';
278const URL_GENERATEBUNDLE = 'plugin-development/#generatebundle';
279
280function error(base) {
281 throw base instanceof Error ? base : getRollupError(base);
282}
283function getRollupError(base) {
284 augmentLogMessage(base);
285 const errorInstance = Object.assign(new Error(base.message), base);
286 Object.defineProperty(errorInstance, 'name', {
287 value: 'RollupError',
288 writable: true
289 });
290 return errorInstance;
291}
292function augmentCodeLocation(properties, pos, source, id) {
293 if (typeof pos === 'object') {
294 const { line, column } = pos;
295 properties.loc = { column, file: id, line };
296 }
297 else {
298 properties.pos = pos;
299 const location = locate(source, pos, { offsetLine: 1 });
300 if (!location) {
301 return;
302 }
303 const { line, column } = location;
304 properties.loc = { column, file: id, line };
305 }
306 if (properties.frame === undefined) {
307 const { line, column } = properties.loc;
308 properties.frame = getCodeFrame(source, line, column);
309 }
310}
311const symbolAugmented = Symbol('augmented');
312function augmentLogMessage(log) {
313 // Make sure to only augment the log message once
314 if (!(log.plugin || log.loc) || log[symbolAugmented]) {
315 return;
316 }
317 log[symbolAugmented] = true;
318 let prefix = '';
319 if (log.plugin) {
320 prefix += `[plugin ${log.plugin}] `;
321 }
322 const id = log.id || log.loc?.file;
323 if (id) {
324 const position = log.loc ? ` (${log.loc.line}:${log.loc.column})` : '';
325 prefix += `${relativeId(id)}${position}: `;
326 }
327 const oldMessage = log.message;
328 log.message = prefix + log.message;
329 tweakStackMessage(log, oldMessage);
330}
331// Error codes should be sorted alphabetically while errors should be sorted by
332// error code below
333const ADDON_ERROR = 'ADDON_ERROR', ALREADY_CLOSED = 'ALREADY_CLOSED', AMBIGUOUS_EXTERNAL_NAMESPACES = 'AMBIGUOUS_EXTERNAL_NAMESPACES', ANONYMOUS_PLUGIN_CACHE = 'ANONYMOUS_PLUGIN_CACHE', ASSET_NOT_FINALISED = 'ASSET_NOT_FINALISED', ASSET_NOT_FOUND = 'ASSET_NOT_FOUND', ASSET_SOURCE_ALREADY_SET = 'ASSET_SOURCE_ALREADY_SET', ASSET_SOURCE_MISSING = 'ASSET_SOURCE_MISSING', BAD_LOADER = 'BAD_LOADER', CANNOT_CALL_NAMESPACE = 'CANNOT_CALL_NAMESPACE', CANNOT_EMIT_FROM_OPTIONS_HOOK = 'CANNOT_EMIT_FROM_OPTIONS_HOOK', CHUNK_NOT_GENERATED = 'CHUNK_NOT_GENERATED', CHUNK_INVALID = 'CHUNK_INVALID', CIRCULAR_DEPENDENCY = 'CIRCULAR_DEPENDENCY', CIRCULAR_REEXPORT = 'CIRCULAR_REEXPORT', CONST_REASSIGN = 'CONST_REASSIGN', CYCLIC_CROSS_CHUNK_REEXPORT = 'CYCLIC_CROSS_CHUNK_REEXPORT', DEPRECATED_FEATURE = 'DEPRECATED_FEATURE', DUPLICATE_ARGUMENT_NAME = 'DUPLICATE_ARGUMENT_NAME', DUPLICATE_EXPORT = 'DUPLICATE_EXPORT', DUPLICATE_IMPORT_OPTIONS = 'DUPLICATE_IMPORT_OPTIONS', DUPLICATE_PLUGIN_NAME = 'DUPLICATE_PLUGIN_NAME', EMPTY_BUNDLE = 'EMPTY_BUNDLE', EVAL = 'EVAL', EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS = 'EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS', EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES = 'EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES', EXTERNAL_SYNTHETIC_EXPORTS = 'EXTERNAL_SYNTHETIC_EXPORTS', FAIL_AFTER_WARNINGS = 'FAIL_AFTER_WARNINGS', FILE_NAME_CONFLICT = 'FILE_NAME_CONFLICT', FILE_NOT_FOUND = 'FILE_NOT_FOUND', FIRST_SIDE_EFFECT = 'FIRST_SIDE_EFFECT', ILLEGAL_IDENTIFIER_AS_NAME = 'ILLEGAL_IDENTIFIER_AS_NAME', ILLEGAL_REASSIGNMENT = 'ILLEGAL_REASSIGNMENT', INCONSISTENT_IMPORT_ATTRIBUTES = 'INCONSISTENT_IMPORT_ATTRIBUTES', INVALID_ANNOTATION = 'INVALID_ANNOTATION', INPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN', INVALID_CHUNK = 'INVALID_CHUNK', INVALID_CONFIG_MODULE_FORMAT = 'INVALID_CONFIG_MODULE_FORMAT', INVALID_EXPORT_OPTION = 'INVALID_EXPORT_OPTION', INVALID_EXTERNAL_ID = 'INVALID_EXTERNAL_ID', INVALID_IMPORT_ATTRIBUTE = 'INVALID_IMPORT_ATTRIBUTE', INVALID_LOG_POSITION = 'INVALID_LOG_POSITION', INVALID_OPTION = 'INVALID_OPTION', INVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK', INVALID_ROLLUP_PHASE = 'INVALID_ROLLUP_PHASE', INVALID_SETASSETSOURCE = 'INVALID_SETASSETSOURCE', INVALID_TLA_FORMAT = 'INVALID_TLA_FORMAT', MISSING_CONFIG = 'MISSING_CONFIG', MISSING_EXPORT = 'MISSING_EXPORT', MISSING_EXTERNAL_CONFIG = 'MISSING_EXTERNAL_CONFIG', MISSING_GLOBAL_NAME = 'MISSING_GLOBAL_NAME', MISSING_IMPLICIT_DEPENDANT = 'MISSING_IMPLICIT_DEPENDANT', MISSING_JSX_EXPORT = 'MISSING_JSX_EXPORT', MISSING_NAME_OPTION_FOR_IIFE_EXPORT = 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', MISSING_NODE_BUILTINS = 'MISSING_NODE_BUILTINS', MISSING_OPTION = 'MISSING_OPTION', MIXED_EXPORTS = 'MIXED_EXPORTS', MODULE_LEVEL_DIRECTIVE = 'MODULE_LEVEL_DIRECTIVE', NAMESPACE_CONFLICT = 'NAMESPACE_CONFLICT', NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE = 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE', ONLY_INLINE_SOURCEMAPS = 'ONLY_INLINE_SOURCEMAPS', OPTIMIZE_CHUNK_STATUS = 'OPTIMIZE_CHUNK_STATUS', PARSE_ERROR = 'PARSE_ERROR', PLUGIN_ERROR = 'PLUGIN_ERROR', REDECLARATION_ERROR = 'REDECLARATION_ERROR', RESERVED_NAMESPACE = 'RESERVED_NAMESPACE', SHIMMED_EXPORT = 'SHIMMED_EXPORT', SOURCEMAP_BROKEN = 'SOURCEMAP_BROKEN', SOURCEMAP_ERROR = 'SOURCEMAP_ERROR', SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT = 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', THIS_IS_UNDEFINED = 'THIS_IS_UNDEFINED', UNEXPECTED_NAMED_IMPORT = 'UNEXPECTED_NAMED_IMPORT', UNKNOWN_OPTION = 'UNKNOWN_OPTION', UNRESOLVED_ENTRY = 'UNRESOLVED_ENTRY', UNRESOLVED_IMPORT = 'UNRESOLVED_IMPORT', UNUSED_EXTERNAL_IMPORT = 'UNUSED_EXTERNAL_IMPORT', VALIDATION_ERROR = 'VALIDATION_ERROR';
334function logAddonNotGenerated(message, hook, plugin) {
335 return {
336 code: ADDON_ERROR,
337 message: `Could not retrieve "${hook}". Check configuration of plugin "${plugin}".
338\tError Message: ${message}`
339 };
340}
341function logAlreadyClosed() {
342 return {
343 code: ALREADY_CLOSED,
344 message: 'Bundle is already closed, no more calls to "generate" or "write" are allowed.'
345 };
346}
347function logAmbiguousExternalNamespaces(binding, reexportingModule, usedModule, sources) {
348 return {
349 binding,
350 code: AMBIGUOUS_EXTERNAL_NAMESPACES,
351 ids: sources,
352 message: `Ambiguous external namespace resolution: "${relativeId(reexportingModule)}" re-exports "${binding}" from one of the external modules ${printQuotedStringList(sources.map(module => relativeId(module)))}, guessing "${relativeId(usedModule)}".`,
353 reexporter: reexportingModule
354 };
355}
356function logAnonymousPluginCache() {
357 return {
358 code: ANONYMOUS_PLUGIN_CACHE,
359 message: 'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.'
360 };
361}
362function logAssetNotFinalisedForFileName(name) {
363 return {
364 code: ASSET_NOT_FINALISED,
365 message: `Plugin error - Unable to get file name for asset "${name}". Ensure that the source is set and that generate is called first. If you reference assets via import.meta.ROLLUP_FILE_URL_<referenceId>, you need to either have set their source after "renderStart" or need to provide an explicit "fileName" when emitting them.`
366 };
367}
368function logAssetReferenceIdNotFoundForSetSource(assetReferenceId) {
369 return {
370 code: ASSET_NOT_FOUND,
371 message: `Plugin error - Unable to set the source for unknown asset "${assetReferenceId}".`
372 };
373}
374function logAssetSourceAlreadySet(name) {
375 return {
376 code: ASSET_SOURCE_ALREADY_SET,
377 message: `Unable to set the source for asset "${name}", source already set.`
378 };
379}
380function logNoAssetSourceSet(assetName) {
381 return {
382 code: ASSET_SOURCE_MISSING,
383 message: `Plugin error creating asset "${assetName}" - no asset source set.`
384 };
385}
386function logBadLoader(id) {
387 return {
388 code: BAD_LOADER,
389 message: `Error loading "${relativeId(id)}": plugin load hook should return a string, a { code, map } object, or nothing/null.`
390 };
391}
392function logCannotCallNamespace(name) {
393 return {
394 code: CANNOT_CALL_NAMESPACE,
395 message: `Cannot call a namespace ("${name}").`
396 };
397}
398function logCannotEmitFromOptionsHook() {
399 return {
400 code: CANNOT_EMIT_FROM_OPTIONS_HOOK,
401 message: `Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.`
402 };
403}
404function logChunkNotGeneratedForFileName(name) {
405 return {
406 code: CHUNK_NOT_GENERATED,
407 message: `Plugin error - Unable to get file name for emitted chunk "${name}". You can only get file names once chunks have been generated after the "renderStart" hook.`
408 };
409}
410function logChunkInvalid({ fileName, code }, { pos, message }) {
411 const errorProperties = {
412 code: CHUNK_INVALID,
413 message: `Chunk "${fileName}" is not valid JavaScript: ${message}.`
414 };
415 augmentCodeLocation(errorProperties, pos, code, fileName);
416 return errorProperties;
417}
418function logCircularDependency(cyclePath) {
419 return {
420 code: CIRCULAR_DEPENDENCY,
421 ids: cyclePath,
422 message: `Circular dependency: ${cyclePath.map(relativeId).join(' -> ')}`
423 };
424}
425function logCircularReexport(exportName, exporter) {
426 return {
427 code: CIRCULAR_REEXPORT,
428 exporter,
429 message: `"${exportName}" cannot be exported from "${relativeId(exporter)}" as it is a reexport that references itself.`
430 };
431}
432function logCyclicCrossChunkReexport(exportName, exporter, reexporter, importer, preserveModules) {
433 return {
434 code: CYCLIC_CROSS_CHUNK_REEXPORT,
435 exporter,
436 id: importer,
437 message: `Export "${exportName}" of module "${relativeId(exporter)}" was reexported through module "${relativeId(reexporter)}" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "${relativeId(importer)}" to point directly to the exporting module or ${preserveModules ? 'do not use "output.preserveModules"' : 'reconfigure "output.manualChunks"'} to ensure these modules end up in the same chunk.`,
438 reexporter
439 };
440}
441function logDeprecation(deprecation, urlSnippet, plugin) {
442 return {
443 code: DEPRECATED_FEATURE,
444 message: deprecation,
445 url: getRollupUrl(urlSnippet),
446 ...({})
447 };
448}
449function logConstVariableReassignError() {
450 return {
451 code: CONST_REASSIGN,
452 message: 'Cannot reassign a variable declared with `const`'
453 };
454}
455function logDuplicateArgumentNameError(name) {
456 return {
457 code: DUPLICATE_ARGUMENT_NAME,
458 message: `Duplicate argument name "${name}"`
459 };
460}
461function logDuplicateExportError(name) {
462 return { code: DUPLICATE_EXPORT, message: `Duplicate export "${name}"` };
463}
464function logDuplicateImportOptions() {
465 return {
466 code: DUPLICATE_IMPORT_OPTIONS,
467 message: 'Either use --input, or pass input path as argument'
468 };
469}
470function logDuplicatePluginName(plugin) {
471 return {
472 code: DUPLICATE_PLUGIN_NAME,
473 message: `The plugin name ${plugin} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).`
474 };
475}
476function logEmptyChunk(chunkName) {
477 return {
478 code: EMPTY_BUNDLE,
479 message: `Generated an empty chunk: "${chunkName}".`,
480 names: [chunkName]
481 };
482}
483function logEval(id) {
484 return {
485 code: EVAL,
486 id,
487 message: `Use of eval in "${relativeId(id)}" is strongly discouraged as it poses security risks and may cause issues with minification.`,
488 url: getRollupUrl(URL_AVOIDING_EVAL)
489 };
490}
491function logExternalSyntheticExports(id, importer) {
492 return {
493 code: EXTERNAL_SYNTHETIC_EXPORTS,
494 exporter: id,
495 message: `External "${id}" cannot have "syntheticNamedExports" enabled (imported by "${relativeId(importer)}").`
496 };
497}
498function logFailAfterWarnings() {
499 return {
500 code: FAIL_AFTER_WARNINGS,
501 message: 'Warnings occurred and --failAfterWarnings flag present.'
502 };
503}
504function logFileNameConflict(fileName) {
505 return {
506 code: FILE_NAME_CONFLICT,
507 message: `The emitted file "${fileName}" overwrites a previously emitted file of the same name.`
508 };
509}
510function logFileReferenceIdNotFoundForFilename(assetReferenceId) {
511 return {
512 code: FILE_NOT_FOUND,
513 message: `Plugin error - Unable to get file name for unknown file "${assetReferenceId}".`
514 };
515}
516function logFirstSideEffect(source, id, { line, column }) {
517 return {
518 code: FIRST_SIDE_EFFECT,
519 message: `First side effect in ${relativeId(id)} is at (${line}:${column})\n${getCodeFrame(source, line, column)}`
520 };
521}
522function logIllegalIdentifierAsName(name) {
523 return {
524 code: ILLEGAL_IDENTIFIER_AS_NAME,
525 message: `Given name "${name}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`,
526 url: getRollupUrl(URL_OUTPUT_EXTEND)
527 };
528}
529function logIllegalImportReassignment(name, importingId) {
530 return {
531 code: ILLEGAL_REASSIGNMENT,
532 message: `Illegal reassignment of import "${name}" in "${relativeId(importingId)}".`
533 };
534}
535function logInconsistentImportAttributes(existingAttributes, newAttributes, source, importer) {
536 return {
537 code: INCONSISTENT_IMPORT_ATTRIBUTES,
538 message: `Module "${relativeId(importer)}" tried to import "${relativeId(source)}" with ${formatAttributes(newAttributes)} attributes, but it was already imported elsewhere with ${formatAttributes(existingAttributes)} attributes. Please ensure that import attributes for the same module are always consistent.`
539 };
540}
541const formatAttributes = (attributes) => {
542 const entries = Object.entries(attributes);
543 if (entries.length === 0)
544 return 'no';
545 return entries.map(([key, value]) => `"${key}": "${value}"`).join(', ');
546};
547function logInvalidAnnotation(comment, id, type) {
548 return {
549 code: INVALID_ANNOTATION,
550 id,
551 message: `A comment\n\n"${comment}"\n\nin "${relativeId(id)}" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.`,
552 url: getRollupUrl(type === 'noSideEffects' ? URL_TREESHAKE_NOSIDEEFFECTS : URL_TREESHAKE_PURE)
553 };
554}
555function logInputHookInOutputPlugin(pluginName, hookName) {
556 return {
557 code: INPUT_HOOK_IN_OUTPUT_PLUGIN,
558 message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`
559 };
560}
561function logCannotAssignModuleToChunk(moduleId, assignToAlias, currentAlias) {
562 return {
563 code: INVALID_CHUNK,
564 message: `Cannot assign "${relativeId(moduleId)}" to the "${assignToAlias}" chunk as it is already in the "${currentAlias}" chunk.`
565 };
566}
567function tweakStackMessage(error, oldMessage) {
568 if (!error.stack) {
569 return error;
570 }
571 error.stack = error.stack.replace(oldMessage, error.message);
572 return error;
573}
574function logCannotBundleConfigAsEsm(originalError) {
575 return tweakStackMessage({
576 cause: originalError,
577 code: INVALID_CONFIG_MODULE_FORMAT,
578 message: `Rollup transpiled your configuration to an ES module even though it appears to contain CommonJS elements. To resolve this, you can pass the "--bundleConfigAsCjs" flag to Rollup or change your configuration to only contain valid ESM code.\n\nOriginal error: ${originalError.message}`,
579 stack: originalError.stack,
580 url: getRollupUrl(URL_BUNDLE_CONFIG_AS_CJS)
581 }, originalError.message);
582}
583function logCannotLoadConfigAsCjs(originalError) {
584 return tweakStackMessage({
585 cause: originalError,
586 code: INVALID_CONFIG_MODULE_FORMAT,
587 message: `Node tried to load your configuration file as CommonJS even though it is likely an ES module. To resolve this, change the extension of your configuration to ".mjs", set "type": "module" in your package.json file or pass the "--bundleConfigAsCjs" flag.\n\nOriginal error: ${originalError.message}`,
588 stack: originalError.stack,
589 url: getRollupUrl(URL_BUNDLE_CONFIG_AS_CJS)
590 }, originalError.message);
591}
592function logCannotLoadConfigAsEsm(originalError) {
593 return tweakStackMessage({
594 cause: originalError,
595 code: INVALID_CONFIG_MODULE_FORMAT,
596 message: `Node tried to load your configuration as an ES module even though it is likely CommonJS. To resolve this, change the extension of your configuration to ".cjs" or pass the "--bundleConfigAsCjs" flag.\n\nOriginal error: ${originalError.message}`,
597 stack: originalError.stack,
598 url: getRollupUrl(URL_BUNDLE_CONFIG_AS_CJS)
599 }, originalError.message);
600}
601function logInvalidExportOptionValue(optionValue) {
602 return {
603 code: INVALID_EXPORT_OPTION,
604 message: `"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${optionValue}".`,
605 url: getRollupUrl(URL_OUTPUT_EXPORTS)
606 };
607}
608function logIncompatibleExportOptionValue(optionValue, keys, entryModule) {
609 return {
610 code: INVALID_EXPORT_OPTION,
611 message: `"${optionValue}" was specified for "output.exports", but entry module "${relativeId(entryModule)}" has the following exports: ${printQuotedStringList(keys)}`,
612 url: getRollupUrl(URL_OUTPUT_EXPORTS)
613 };
614}
615function logInternalIdCannotBeExternal(source, importer) {
616 return {
617 code: INVALID_EXTERNAL_ID,
618 message: `"${source}" is imported as an external by "${relativeId(importer)}", but is already an existing non-external module id.`
619 };
620}
621function logImportOptionsAreInvalid(importer) {
622 return {
623 code: INVALID_IMPORT_ATTRIBUTE,
624 message: `Rollup could not statically analyze the options argument of a dynamic import in "${relativeId(importer)}". Dynamic import options need to be an object with a nested attributes object.`
625 };
626}
627function logImportAttributeIsInvalid(importer) {
628 return {
629 code: INVALID_IMPORT_ATTRIBUTE,
630 message: `Rollup could not statically analyze an import attribute of a dynamic import in "${relativeId(importer)}". Import attributes need to have string keys and values. The attribute will be removed.`
631 };
632}
633function logInvalidLogPosition(plugin) {
634 return {
635 code: INVALID_LOG_POSITION,
636 message: `Plugin "${plugin}" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.`
637 };
638}
639function logInvalidOption(option, urlSnippet, explanation, value) {
640 return {
641 code: INVALID_OPTION,
642 message: `Invalid value ${value === undefined ? '' : `${JSON.stringify(value)} `}for option "${option}" - ${explanation}.`,
643 url: getRollupUrl(urlSnippet)
644 };
645}
646function logInvalidAddonPluginHook(hook, plugin) {
647 return {
648 code: INVALID_PLUGIN_HOOK,
649 hook,
650 message: `Error running plugin hook "${hook}" for plugin "${plugin}", expected a string, a function hook or an object with a "handler" string or function.`,
651 plugin
652 };
653}
654function logInvalidFunctionPluginHook(hook, plugin) {
655 return {
656 code: INVALID_PLUGIN_HOOK,
657 hook,
658 message: `Error running plugin hook "${hook}" for plugin "${plugin}", expected a function hook or an object with a "handler" function.`,
659 plugin
660 };
661}
662function logInvalidRollupPhaseForChunkEmission() {
663 return {
664 code: INVALID_ROLLUP_PHASE,
665 message: `Cannot emit chunks after module loading has finished.`
666 };
667}
668function logInvalidSetAssetSourceCall() {
669 return {
670 code: INVALID_SETASSETSOURCE,
671 message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.`
672 };
673}
674function logInvalidFormatForTopLevelAwait(id, format) {
675 return {
676 code: INVALID_TLA_FORMAT,
677 id,
678 message: `Module format "${format}" does not support top-level await. Use the "es" or "system" output formats rather.`
679 };
680}
681function logMissingConfig() {
682 return {
683 code: MISSING_CONFIG,
684 message: 'Config file must export an options object, or an array of options objects',
685 url: getRollupUrl(URL_CONFIGURATION_FILES)
686 };
687}
688function logMissingEntryExport(binding, exporter) {
689 return {
690 binding,
691 code: MISSING_EXPORT,
692 exporter,
693 message: `Exported variable "${binding}" is not defined in "${relativeId(exporter)}".`,
694 url: getRollupUrl(URL_NAME_IS_NOT_EXPORTED)
695 };
696}
697function logMissingExport(binding, importingModule, exporter) {
698 const isJson = path.extname(exporter) === '.json';
699 return {
700 binding,
701 code: MISSING_EXPORT,
702 exporter,
703 id: importingModule,
704 message: `"${binding}" is not exported by "${relativeId(exporter)}", imported by "${relativeId(importingModule)}".${isJson ? ' (Note that you need @rollup/plugin-json to import JSON files)' : ''}`,
705 url: getRollupUrl(URL_NAME_IS_NOT_EXPORTED)
706 };
707}
708function logMissingExternalConfig(file) {
709 return {
710 code: MISSING_EXTERNAL_CONFIG,
711 message: `Could not resolve config file "${file}"`
712 };
713}
714function logMissingGlobalName(externalId, guess) {
715 return {
716 code: MISSING_GLOBAL_NAME,
717 id: externalId,
718 message: `No name was provided for external module "${externalId}" in "output.globals" – guessing "${guess}".`,
719 names: [guess],
720 url: getRollupUrl(URL_OUTPUT_GLOBALS)
721 };
722}
723function logImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore) {
724 return {
725 code: MISSING_IMPLICIT_DEPENDANT,
726 message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" cannot be external.`
727 };
728}
729function logUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore) {
730 return {
731 code: MISSING_IMPLICIT_DEPENDANT,
732 message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" could not be resolved.`
733 };
734}
735function logImplicitDependantIsNotIncluded(module) {
736 const implicitDependencies = [...module.implicitlyLoadedBefore]
737 .map(dependency => relativeId(dependency.id))
738 .sort();
739 return {
740 code: MISSING_IMPLICIT_DEPENDANT,
741 message: `Module "${relativeId(module.id)}" that should be implicitly loaded before ${printQuotedStringList(implicitDependencies)} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`
742 };
743}
744function logMissingJsxExport(name, exporter, importer) {
745 return {
746 code: MISSING_JSX_EXPORT,
747 exporter,
748 id: importer,
749 message: `Export "${name}" is not defined in module "${relativeId(exporter)}" even though it is needed in "${relativeId(importer)}" to provide JSX syntax. Please check your "jsx" option.`,
750 names: [name],
751 url: getRollupUrl(URL_JSX)
752 };
753}
754function logMissingNameOptionForIifeExport() {
755 return {
756 code: MISSING_NAME_OPTION_FOR_IIFE_EXPORT,
757 message: `If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.`,
758 url: getRollupUrl(URL_OUTPUT_NAME)
759 };
760}
761function logMissingNameOptionForUmdExport() {
762 return {
763 code: MISSING_NAME_OPTION_FOR_IIFE_EXPORT,
764 message: 'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.',
765 url: getRollupUrl(URL_OUTPUT_NAME)
766 };
767}
768function logMissingNodeBuiltins(externalBuiltins) {
769 return {
770 code: MISSING_NODE_BUILTINS,
771 ids: externalBuiltins,
772 message: `Creating a browser bundle that depends on Node.js built-in modules (${printQuotedStringList(externalBuiltins)}). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`
773 };
774}
775function logMissingFileOrDirOption() {
776 return {
777 code: MISSING_OPTION,
778 message: 'You must specify "output.file" or "output.dir" for the build.',
779 url: getRollupUrl(URL_OUTPUT_DIR)
780 };
781}
782function logMixedExport(facadeModuleId, name) {
783 return {
784 code: MIXED_EXPORTS,
785 id: facadeModuleId,
786 message: `Entry module "${relativeId(facadeModuleId)}" is using named and default exports together. Consumers of your bundle will have to use \`${name || 'chunk'}.default\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning.`,
787 url: getRollupUrl(URL_OUTPUT_EXPORTS)
788 };
789}
790function logModuleLevelDirective(directive, id) {
791 return {
792 code: MODULE_LEVEL_DIRECTIVE,
793 id,
794 message: `Module level directives cause errors when bundled, "${directive}" in "${relativeId(id)}" was ignored.`
795 };
796}
797function logNamespaceConflict(binding, reexportingModuleId, sources) {
798 return {
799 binding,
800 code: NAMESPACE_CONFLICT,
801 ids: sources,
802 message: `Conflicting namespaces: "${relativeId(reexportingModuleId)}" re-exports "${binding}" from one of the modules ${printQuotedStringList(sources.map(moduleId => relativeId(moduleId)))} (will be ignored).`,
803 reexporter: reexportingModuleId
804 };
805}
806function logNoTransformMapOrAstWithoutCode(pluginName) {
807 return {
808 code: NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE,
809 message: `The plugin "${pluginName}" returned a "map" or "ast" without returning ` +
810 'a "code". This will be ignored.'
811 };
812}
813function logOnlyInlineSourcemapsForStdout() {
814 return {
815 code: ONLY_INLINE_SOURCEMAPS,
816 message: 'Only inline sourcemaps are supported when bundling to stdout.'
817 };
818}
819function logOptimizeChunkStatus(chunks, smallChunks, pointInTime) {
820 return {
821 code: OPTIMIZE_CHUNK_STATUS,
822 message: `${pointInTime}, there are\n` +
823 `${chunks} chunks, of which\n` +
824 `${smallChunks} are below minChunkSize.`
825 };
826}
827function logParseError(message, pos) {
828 return { code: PARSE_ERROR, message, pos };
829}
830function logRedeclarationError(name) {
831 return {
832 code: REDECLARATION_ERROR,
833 message: `Identifier "${name}" has already been declared`
834 };
835}
836function logReservedNamespace(namespace) {
837 return {
838 code: RESERVED_NAMESPACE,
839 message: `You have overided reserved namespace "${namespace}"`
840 };
841}
842function logModuleParseError(error, moduleId) {
843 let message = error.message.replace(/ \(\d+:\d+\)$/, '');
844 if (moduleId.endsWith('.json')) {
845 message += ' (Note that you need @rollup/plugin-json to import JSON files)';
846 }
847 else if (!moduleId.endsWith('.js')) {
848 message += ' (Note that you need plugins to import files that are not JavaScript)';
849 }
850 return tweakStackMessage({
851 cause: error,
852 code: PARSE_ERROR,
853 id: moduleId,
854 message,
855 stack: error.stack
856 }, error.message);
857}
858function logPluginError(error, plugin, { hook, id } = {}) {
859 const code = error.code;
860 if (!error.pluginCode &&
861 code != null &&
862 (typeof code !== 'string' || !code.startsWith('PLUGIN_'))) {
863 error.pluginCode = code;
864 }
865 error.code = PLUGIN_ERROR;
866 error.plugin = plugin;
867 if (hook) {
868 error.hook = hook;
869 }
870 if (id) {
871 error.id = id;
872 }
873 return error;
874}
875function logShimmedExport(id, binding) {
876 return {
877 binding,
878 code: SHIMMED_EXPORT,
879 exporter: id,
880 message: `Missing export "${binding}" has been shimmed in module "${relativeId(id)}".`
881 };
882}
883function logSourcemapBroken(plugin) {
884 return {
885 code: SOURCEMAP_BROKEN,
886 message: `Sourcemap is likely to be incorrect: a plugin (${plugin}) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`,
887 plugin,
888 url: getRollupUrl(URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT)
889 };
890}
891function logConflictingSourcemapSources(filename) {
892 return {
893 code: SOURCEMAP_BROKEN,
894 message: `Multiple conflicting contents for sourcemap source ${filename}`
895 };
896}
897function logInvalidSourcemapForError(error, id, column, line, pos) {
898 return {
899 cause: error,
900 code: SOURCEMAP_ERROR,
901 id,
902 loc: {
903 column,
904 file: id,
905 line
906 },
907 message: `Error when using sourcemap for reporting an error: ${error.message}`,
908 pos
909 };
910}
911function logSyntheticNamedExportsNeedNamespaceExport(id, syntheticNamedExportsOption) {
912 return {
913 code: SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT,
914 exporter: id,
915 message: `Module "${relativeId(id)}" that is marked with \`syntheticNamedExports: ${JSON.stringify(syntheticNamedExportsOption)}\` needs ${typeof syntheticNamedExportsOption === 'string' && syntheticNamedExportsOption !== 'default'
916 ? `an explicit export named "${syntheticNamedExportsOption}"`
917 : 'a default export'} that does not reexport an unresolved named export of the same module.`
918 };
919}
920function logThisIsUndefined() {
921 return {
922 code: THIS_IS_UNDEFINED,
923 message: `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`,
924 url: getRollupUrl(URL_THIS_IS_UNDEFINED)
925 };
926}
927function logUnexpectedNamedImport(id, imported, isReexport) {
928 const importType = isReexport ? 'reexport' : 'import';
929 return {
930 code: UNEXPECTED_NAMED_IMPORT,
931 exporter: id,
932 message: `The named export "${imported}" was ${importType}ed from the external module "${relativeId(id)}" even though its interop type is "defaultOnly". Either remove or change this ${importType} or change the value of the "output.interop" option.`,
933 url: getRollupUrl(URL_OUTPUT_INTEROP)
934 };
935}
936function logUnexpectedNamespaceReexport(id) {
937 return {
938 code: UNEXPECTED_NAMED_IMPORT,
939 exporter: id,
940 message: `There was a namespace "*" reexport from the external module "${relativeId(id)}" even though its interop type is "defaultOnly". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the "output.interop" option.`,
941 url: getRollupUrl(URL_OUTPUT_INTEROP)
942 };
943}
944function logUnknownOption(optionType, unknownOptions, validOptions) {
945 return {
946 code: UNKNOWN_OPTION,
947 message: `Unknown ${optionType}: ${unknownOptions.join(', ')}. Allowed options: ${validOptions.join(', ')}`
948 };
949}
950function logEntryCannotBeExternal(unresolvedId) {
951 return {
952 code: UNRESOLVED_ENTRY,
953 message: `Entry module "${relativeId(unresolvedId)}" cannot be external.`
954 };
955}
956function logExternalModulesCannotBeIncludedInManualChunks(source) {
957 return {
958 code: EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS,
959 message: `"${source}" cannot be included in manualChunks because it is resolved as an external module by the "external" option or plugins.`
960 };
961}
962function logExternalModulesCannotBeTransformedToModules(source) {
963 return {
964 code: EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES,
965 message: `${source} is resolved as a module now, but it was an external module before. Please check whether there are conflicts in your Rollup options "external" and "manualChunks", manualChunks cannot include external modules.`
966 };
967}
968function logUnresolvedEntry(unresolvedId) {
969 return {
970 code: UNRESOLVED_ENTRY,
971 message: `Could not resolve entry module "${relativeId(unresolvedId)}".`
972 };
973}
974function logUnresolvedImport(source, importer) {
975 return {
976 code: UNRESOLVED_IMPORT,
977 exporter: source,
978 id: importer,
979 message: `Could not resolve "${source}" from "${relativeId(importer)}"`
980 };
981}
982function logUnresolvedImportTreatedAsExternal(source, importer) {
983 return {
984 code: UNRESOLVED_IMPORT,
985 exporter: source,
986 id: importer,
987 message: `"${source}" is imported by "${relativeId(importer)}", but could not be resolved – treating it as an external dependency.`,
988 url: getRollupUrl(URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY)
989 };
990}
991function logUnusedExternalImports(externalId, names, importers) {
992 return {
993 code: UNUSED_EXTERNAL_IMPORT,
994 exporter: externalId,
995 ids: importers,
996 message: `${printQuotedStringList(names, [
997 'is',
998 'are'
999 ])} imported from external module "${externalId}" but never used in ${printQuotedStringList(importers.map(importer => relativeId(importer)))}.`,
1000 names
1001 };
1002}
1003function logFailedValidation(message) {
1004 return {
1005 code: VALIDATION_ERROR,
1006 message
1007 };
1008}
1009function warnDeprecation(deprecation, urlSnippet, activeDeprecation, options, plugin) {
1010 warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, options.onLog, options.strictDeprecations);
1011}
1012function warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, log, strictDeprecations, plugin) {
1013 if (activeDeprecation || strictDeprecations) {
1014 const warning = logDeprecation(deprecation, urlSnippet);
1015 if (strictDeprecations) {
1016 return error(warning);
1017 }
1018 log(LOGLEVEL_WARN, warning);
1019 }
1020}
1021
1022const BLANK = Object.freeze(Object.create(null));
1023const EMPTY_OBJECT = Object.freeze({});
1024const EMPTY_ARRAY = Object.freeze([]);
1025const EMPTY_SET = Object.freeze(new (class extends Set {
1026 add() {
1027 throw new Error('Cannot add to empty set');
1028 }
1029})());
1030
1031// This file is generated by scripts/generate-node-types.js.
1032// Do not edit this file directly.
1033const ArrowFunctionExpression = 'ArrowFunctionExpression';
1034const BlockStatement = 'BlockStatement';
1035const CallExpression = 'CallExpression';
1036const CatchClause = 'CatchClause';
1037const ExportDefaultDeclaration = 'ExportDefaultDeclaration';
1038const ExpressionStatement = 'ExpressionStatement';
1039const Identifier = 'Identifier';
1040const Literal = 'Literal';
1041const ObjectExpression = 'ObjectExpression';
1042const PanicError = 'PanicError';
1043const ParseError = 'ParseError';
1044const Program = 'Program';
1045const Property = 'Property';
1046const ReturnStatement = 'ReturnStatement';
1047const StaticBlock = 'StaticBlock';
1048const TemplateLiteral = 'TemplateLiteral';
1049const VariableDeclarator = 'VariableDeclarator';
1050
1051// This file is generated by scripts/generate-string-constants.js.
1052// Do not edit this file directly.
1053const FIXED_STRINGS = [
1054 'var',
1055 'let',
1056 'const',
1057 'init',
1058 'get',
1059 'set',
1060 'constructor',
1061 'method',
1062 '-',
1063 '+',
1064 '!',
1065 '~',
1066 'typeof',
1067 'void',
1068 'delete',
1069 '++',
1070 '--',
1071 '==',
1072 '!=',
1073 '===',
1074 '!==',
1075 '<',
1076 '<=',
1077 '>',
1078 '>=',
1079 '<<',
1080 '>>',
1081 '>>>',
1082 '+',
1083 '-',
1084 '*',
1085 '/',
1086 '%',
1087 '|',
1088 '^',
1089 '&',
1090 '||',
1091 '&&',
1092 'in',
1093 'instanceof',
1094 '**',
1095 '??',
1096 '=',
1097 '+=',
1098 '-=',
1099 '*=',
1100 '/=',
1101 '%=',
1102 '<<=',
1103 '>>=',
1104 '>>>=',
1105 '|=',
1106 '^=',
1107 '&=',
1108 '**=',
1109 '&&=',
1110 '||=',
1111 '??=',
1112 'pure',
1113 'noSideEffects',
1114 'sourcemap',
1115 'using',
1116 'await using'
1117];
1118
1119const ANNOTATION_KEY = '_rollupAnnotations';
1120const INVALID_ANNOTATION_KEY = '_rollupRemoved';
1121const convertAnnotations = (position, buffer) => {
1122 if (position === 0)
1123 return EMPTY_ARRAY;
1124 const length = buffer[position++];
1125 const list = new Array(length);
1126 for (let index = 0; index < length; index++) {
1127 list[index] = convertAnnotation(buffer[position++], buffer);
1128 }
1129 return list;
1130};
1131const convertAnnotation = (position, buffer) => {
1132 const start = buffer[position++];
1133 const end = buffer[position++];
1134 const type = FIXED_STRINGS[buffer[position]];
1135 return { end, start, type };
1136};
1137
1138// This file is generated by scripts/generate-buffer-to-ast.js.
1139// Do not edit this file directly.
1140function convertProgram(buffer) {
1141 const node = convertNode(0, buffer);
1142 switch (node.type) {
1143 case PanicError: {
1144 return error(getRollupError(logParseError(node.message)));
1145 }
1146 case ParseError: {
1147 return error(getRollupError(logParseError(node.message, node.start)));
1148 }
1149 default: {
1150 return node;
1151 }
1152 }
1153}
1154/* eslint-disable sort-keys */
1155const nodeConverters = [
1156 function panicError(position, buffer) {
1157 return {
1158 type: 'PanicError',
1159 start: buffer[position],
1160 end: buffer[position + 1],
1161 message: buffer.convertString(buffer[position + 2])
1162 };
1163 },
1164 function parseError(position, buffer) {
1165 return {
1166 type: 'ParseError',
1167 start: buffer[position],
1168 end: buffer[position + 1],
1169 message: buffer.convertString(buffer[position + 2])
1170 };
1171 },
1172 function arrayExpression(position, buffer) {
1173 return {
1174 type: 'ArrayExpression',
1175 start: buffer[position],
1176 end: buffer[position + 1],
1177 elements: convertNodeList(buffer[position + 2], buffer)
1178 };
1179 },
1180 function arrayPattern(position, buffer) {
1181 return {
1182 type: 'ArrayPattern',
1183 start: buffer[position],
1184 end: buffer[position + 1],
1185 elements: convertNodeList(buffer[position + 2], buffer)
1186 };
1187 },
1188 function arrowFunctionExpression(position, buffer) {
1189 const flags = buffer[position + 2];
1190 const annotations = convertAnnotations(buffer[position + 3], buffer);
1191 return {
1192 type: 'ArrowFunctionExpression',
1193 start: buffer[position],
1194 end: buffer[position + 1],
1195 async: (flags & 1) === 1,
1196 expression: (flags & 2) === 2,
1197 generator: (flags & 4) === 4,
1198 ...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}),
1199 params: convertNodeList(buffer[position + 4], buffer),
1200 body: convertNode(buffer[position + 5], buffer),
1201 id: null
1202 };
1203 },
1204 function assignmentExpression(position, buffer) {
1205 return {
1206 type: 'AssignmentExpression',
1207 start: buffer[position],
1208 end: buffer[position + 1],
1209 operator: FIXED_STRINGS[buffer[position + 2]],
1210 left: convertNode(buffer[position + 3], buffer),
1211 right: convertNode(buffer[position + 4], buffer)
1212 };
1213 },
1214 function assignmentPattern(position, buffer) {
1215 return {
1216 type: 'AssignmentPattern',
1217 start: buffer[position],
1218 end: buffer[position + 1],
1219 left: convertNode(buffer[position + 2], buffer),
1220 right: convertNode(buffer[position + 3], buffer)
1221 };
1222 },
1223 function awaitExpression(position, buffer) {
1224 return {
1225 type: 'AwaitExpression',
1226 start: buffer[position],
1227 end: buffer[position + 1],
1228 argument: convertNode(buffer[position + 2], buffer)
1229 };
1230 },
1231 function binaryExpression(position, buffer) {
1232 return {
1233 type: 'BinaryExpression',
1234 start: buffer[position],
1235 end: buffer[position + 1],
1236 operator: FIXED_STRINGS[buffer[position + 2]],
1237 left: convertNode(buffer[position + 3], buffer),
1238 right: convertNode(buffer[position + 4], buffer)
1239 };
1240 },
1241 function blockStatement(position, buffer) {
1242 return {
1243 type: 'BlockStatement',
1244 start: buffer[position],
1245 end: buffer[position + 1],
1246 body: convertNodeList(buffer[position + 2], buffer)
1247 };
1248 },
1249 function breakStatement(position, buffer) {
1250 const labelPosition = buffer[position + 2];
1251 return {
1252 type: 'BreakStatement',
1253 start: buffer[position],
1254 end: buffer[position + 1],
1255 label: labelPosition === 0 ? null : convertNode(labelPosition, buffer)
1256 };
1257 },
1258 function callExpression(position, buffer) {
1259 const flags = buffer[position + 2];
1260 const annotations = convertAnnotations(buffer[position + 3], buffer);
1261 return {
1262 type: 'CallExpression',
1263 start: buffer[position],
1264 end: buffer[position + 1],
1265 optional: (flags & 1) === 1,
1266 ...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}),
1267 callee: convertNode(buffer[position + 4], buffer),
1268 arguments: convertNodeList(buffer[position + 5], buffer)
1269 };
1270 },
1271 function catchClause(position, buffer) {
1272 const parameterPosition = buffer[position + 2];
1273 return {
1274 type: 'CatchClause',
1275 start: buffer[position],
1276 end: buffer[position + 1],
1277 param: parameterPosition === 0 ? null : convertNode(parameterPosition, buffer),
1278 body: convertNode(buffer[position + 3], buffer)
1279 };
1280 },
1281 function chainExpression(position, buffer) {
1282 return {
1283 type: 'ChainExpression',
1284 start: buffer[position],
1285 end: buffer[position + 1],
1286 expression: convertNode(buffer[position + 2], buffer)
1287 };
1288 },
1289 function classBody(position, buffer) {
1290 return {
1291 type: 'ClassBody',
1292 start: buffer[position],
1293 end: buffer[position + 1],
1294 body: convertNodeList(buffer[position + 2], buffer)
1295 };
1296 },
1297 function classDeclaration(position, buffer) {
1298 const idPosition = buffer[position + 3];
1299 const superClassPosition = buffer[position + 4];
1300 return {
1301 type: 'ClassDeclaration',
1302 start: buffer[position],
1303 end: buffer[position + 1],
1304 decorators: convertNodeList(buffer[position + 2], buffer),
1305 id: idPosition === 0 ? null : convertNode(idPosition, buffer),
1306 superClass: superClassPosition === 0 ? null : convertNode(superClassPosition, buffer),
1307 body: convertNode(buffer[position + 5], buffer)
1308 };
1309 },
1310 function classExpression(position, buffer) {
1311 const idPosition = buffer[position + 3];
1312 const superClassPosition = buffer[position + 4];
1313 return {
1314 type: 'ClassExpression',
1315 start: buffer[position],
1316 end: buffer[position + 1],
1317 decorators: convertNodeList(buffer[position + 2], buffer),
1318 id: idPosition === 0 ? null : convertNode(idPosition, buffer),
1319 superClass: superClassPosition === 0 ? null : convertNode(superClassPosition, buffer),
1320 body: convertNode(buffer[position + 5], buffer)
1321 };
1322 },
1323 function conditionalExpression(position, buffer) {
1324 return {
1325 type: 'ConditionalExpression',
1326 start: buffer[position],
1327 end: buffer[position + 1],
1328 test: convertNode(buffer[position + 2], buffer),
1329 consequent: convertNode(buffer[position + 3], buffer),
1330 alternate: convertNode(buffer[position + 4], buffer)
1331 };
1332 },
1333 function continueStatement(position, buffer) {
1334 const labelPosition = buffer[position + 2];
1335 return {
1336 type: 'ContinueStatement',
1337 start: buffer[position],
1338 end: buffer[position + 1],
1339 label: labelPosition === 0 ? null : convertNode(labelPosition, buffer)
1340 };
1341 },
1342 function debuggerStatement(position, buffer) {
1343 return {
1344 type: 'DebuggerStatement',
1345 start: buffer[position],
1346 end: buffer[position + 1]
1347 };
1348 },
1349 function decorator(position, buffer) {
1350 return {
1351 type: 'Decorator',
1352 start: buffer[position],
1353 end: buffer[position + 1],
1354 expression: convertNode(buffer[position + 2], buffer)
1355 };
1356 },
1357 function directive(position, buffer) {
1358 return {
1359 type: 'ExpressionStatement',
1360 start: buffer[position],
1361 end: buffer[position + 1],
1362 directive: buffer.convertString(buffer[position + 2]),
1363 expression: convertNode(buffer[position + 3], buffer)
1364 };
1365 },
1366 function doWhileStatement(position, buffer) {
1367 return {
1368 type: 'DoWhileStatement',
1369 start: buffer[position],
1370 end: buffer[position + 1],
1371 body: convertNode(buffer[position + 2], buffer),
1372 test: convertNode(buffer[position + 3], buffer)
1373 };
1374 },
1375 function emptyStatement(position, buffer) {
1376 return {
1377 type: 'EmptyStatement',
1378 start: buffer[position],
1379 end: buffer[position + 1]
1380 };
1381 },
1382 function exportAllDeclaration(position, buffer) {
1383 const exportedPosition = buffer[position + 2];
1384 return {
1385 type: 'ExportAllDeclaration',
1386 start: buffer[position],
1387 end: buffer[position + 1],
1388 exported: exportedPosition === 0 ? null : convertNode(exportedPosition, buffer),
1389 source: convertNode(buffer[position + 3], buffer),
1390 attributes: convertNodeList(buffer[position + 4], buffer)
1391 };
1392 },
1393 function exportDefaultDeclaration(position, buffer) {
1394 return {
1395 type: 'ExportDefaultDeclaration',
1396 start: buffer[position],
1397 end: buffer[position + 1],
1398 declaration: convertNode(buffer[position + 2], buffer)
1399 };
1400 },
1401 function exportNamedDeclaration(position, buffer) {
1402 const sourcePosition = buffer[position + 3];
1403 const declarationPosition = buffer[position + 5];
1404 return {
1405 type: 'ExportNamedDeclaration',
1406 start: buffer[position],
1407 end: buffer[position + 1],
1408 specifiers: convertNodeList(buffer[position + 2], buffer),
1409 source: sourcePosition === 0 ? null : convertNode(sourcePosition, buffer),
1410 attributes: convertNodeList(buffer[position + 4], buffer),
1411 declaration: declarationPosition === 0 ? null : convertNode(declarationPosition, buffer)
1412 };
1413 },
1414 function exportSpecifier(position, buffer) {
1415 const local = convertNode(buffer[position + 2], buffer);
1416 const exportedPosition = buffer[position + 3];
1417 return {
1418 type: 'ExportSpecifier',
1419 start: buffer[position],
1420 end: buffer[position + 1],
1421 local,
1422 exported: exportedPosition === 0 ? { ...local } : convertNode(exportedPosition, buffer)
1423 };
1424 },
1425 function expressionStatement(position, buffer) {
1426 return {
1427 type: 'ExpressionStatement',
1428 start: buffer[position],
1429 end: buffer[position + 1],
1430 expression: convertNode(buffer[position + 2], buffer)
1431 };
1432 },
1433 function forInStatement(position, buffer) {
1434 return {
1435 type: 'ForInStatement',
1436 start: buffer[position],
1437 end: buffer[position + 1],
1438 left: convertNode(buffer[position + 2], buffer),
1439 right: convertNode(buffer[position + 3], buffer),
1440 body: convertNode(buffer[position + 4], buffer)
1441 };
1442 },
1443 function forOfStatement(position, buffer) {
1444 const flags = buffer[position + 2];
1445 return {
1446 type: 'ForOfStatement',
1447 start: buffer[position],
1448 end: buffer[position + 1],
1449 await: (flags & 1) === 1,
1450 left: convertNode(buffer[position + 3], buffer),
1451 right: convertNode(buffer[position + 4], buffer),
1452 body: convertNode(buffer[position + 5], buffer)
1453 };
1454 },
1455 function forStatement(position, buffer) {
1456 const initPosition = buffer[position + 2];
1457 const testPosition = buffer[position + 3];
1458 const updatePosition = buffer[position + 4];
1459 return {
1460 type: 'ForStatement',
1461 start: buffer[position],
1462 end: buffer[position + 1],
1463 init: initPosition === 0 ? null : convertNode(initPosition, buffer),
1464 test: testPosition === 0 ? null : convertNode(testPosition, buffer),
1465 update: updatePosition === 0 ? null : convertNode(updatePosition, buffer),
1466 body: convertNode(buffer[position + 5], buffer)
1467 };
1468 },
1469 function functionDeclaration(position, buffer) {
1470 const flags = buffer[position + 2];
1471 const annotations = convertAnnotations(buffer[position + 3], buffer);
1472 const idPosition = buffer[position + 4];
1473 return {
1474 type: 'FunctionDeclaration',
1475 start: buffer[position],
1476 end: buffer[position + 1],
1477 async: (flags & 1) === 1,
1478 generator: (flags & 2) === 2,
1479 ...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}),
1480 id: idPosition === 0 ? null : convertNode(idPosition, buffer),
1481 params: convertNodeList(buffer[position + 5], buffer),
1482 body: convertNode(buffer[position + 6], buffer),
1483 expression: false
1484 };
1485 },
1486 function functionExpression(position, buffer) {
1487 const flags = buffer[position + 2];
1488 const annotations = convertAnnotations(buffer[position + 3], buffer);
1489 const idPosition = buffer[position + 4];
1490 return {
1491 type: 'FunctionExpression',
1492 start: buffer[position],
1493 end: buffer[position + 1],
1494 async: (flags & 1) === 1,
1495 generator: (flags & 2) === 2,
1496 ...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}),
1497 id: idPosition === 0 ? null : convertNode(idPosition, buffer),
1498 params: convertNodeList(buffer[position + 5], buffer),
1499 body: convertNode(buffer[position + 6], buffer),
1500 expression: false
1501 };
1502 },
1503 function identifier(position, buffer) {
1504 return {
1505 type: 'Identifier',
1506 start: buffer[position],
1507 end: buffer[position + 1],
1508 name: buffer.convertString(buffer[position + 2])
1509 };
1510 },
1511 function ifStatement(position, buffer) {
1512 const alternatePosition = buffer[position + 4];
1513 return {
1514 type: 'IfStatement',
1515 start: buffer[position],
1516 end: buffer[position + 1],
1517 test: convertNode(buffer[position + 2], buffer),
1518 consequent: convertNode(buffer[position + 3], buffer),
1519 alternate: alternatePosition === 0 ? null : convertNode(alternatePosition, buffer)
1520 };
1521 },
1522 function importAttribute(position, buffer) {
1523 return {
1524 type: 'ImportAttribute',
1525 start: buffer[position],
1526 end: buffer[position + 1],
1527 key: convertNode(buffer[position + 2], buffer),
1528 value: convertNode(buffer[position + 3], buffer)
1529 };
1530 },
1531 function importDeclaration(position, buffer) {
1532 return {
1533 type: 'ImportDeclaration',
1534 start: buffer[position],
1535 end: buffer[position + 1],
1536 specifiers: convertNodeList(buffer[position + 2], buffer),
1537 source: convertNode(buffer[position + 3], buffer),
1538 attributes: convertNodeList(buffer[position + 4], buffer)
1539 };
1540 },
1541 function importDefaultSpecifier(position, buffer) {
1542 return {
1543 type: 'ImportDefaultSpecifier',
1544 start: buffer[position],
1545 end: buffer[position + 1],
1546 local: convertNode(buffer[position + 2], buffer)
1547 };
1548 },
1549 function importExpression(position, buffer) {
1550 const optionsPosition = buffer[position + 3];
1551 return {
1552 type: 'ImportExpression',
1553 start: buffer[position],
1554 end: buffer[position + 1],
1555 source: convertNode(buffer[position + 2], buffer),
1556 options: optionsPosition === 0 ? null : convertNode(optionsPosition, buffer)
1557 };
1558 },
1559 function importNamespaceSpecifier(position, buffer) {
1560 return {
1561 type: 'ImportNamespaceSpecifier',
1562 start: buffer[position],
1563 end: buffer[position + 1],
1564 local: convertNode(buffer[position + 2], buffer)
1565 };
1566 },
1567 function importSpecifier(position, buffer) {
1568 const importedPosition = buffer[position + 2];
1569 const local = convertNode(buffer[position + 3], buffer);
1570 return {
1571 type: 'ImportSpecifier',
1572 start: buffer[position],
1573 end: buffer[position + 1],
1574 imported: importedPosition === 0 ? { ...local } : convertNode(importedPosition, buffer),
1575 local
1576 };
1577 },
1578 function jsxAttribute(position, buffer) {
1579 const valuePosition = buffer[position + 3];
1580 return {
1581 type: 'JSXAttribute',
1582 start: buffer[position],
1583 end: buffer[position + 1],
1584 name: convertNode(buffer[position + 2], buffer),
1585 value: valuePosition === 0 ? null : convertNode(valuePosition, buffer)
1586 };
1587 },
1588 function jsxClosingElement(position, buffer) {
1589 return {
1590 type: 'JSXClosingElement',
1591 start: buffer[position],
1592 end: buffer[position + 1],
1593 name: convertNode(buffer[position + 2], buffer)
1594 };
1595 },
1596 function jsxClosingFragment(position, buffer) {
1597 return {
1598 type: 'JSXClosingFragment',
1599 start: buffer[position],
1600 end: buffer[position + 1]
1601 };
1602 },
1603 function jsxElement(position, buffer) {
1604 const closingElementPosition = buffer[position + 4];
1605 return {
1606 type: 'JSXElement',
1607 start: buffer[position],
1608 end: buffer[position + 1],
1609 openingElement: convertNode(buffer[position + 2], buffer),
1610 children: convertNodeList(buffer[position + 3], buffer),
1611 closingElement: closingElementPosition === 0 ? null : convertNode(closingElementPosition, buffer)
1612 };
1613 },
1614 function jsxEmptyExpression(position, buffer) {
1615 return {
1616 type: 'JSXEmptyExpression',
1617 start: buffer[position],
1618 end: buffer[position + 1]
1619 };
1620 },
1621 function jsxExpressionContainer(position, buffer) {
1622 return {
1623 type: 'JSXExpressionContainer',
1624 start: buffer[position],
1625 end: buffer[position + 1],
1626 expression: convertNode(buffer[position + 2], buffer)
1627 };
1628 },
1629 function jsxFragment(position, buffer) {
1630 return {
1631 type: 'JSXFragment',
1632 start: buffer[position],
1633 end: buffer[position + 1],
1634 openingFragment: convertNode(buffer[position + 2], buffer),
1635 children: convertNodeList(buffer[position + 3], buffer),
1636 closingFragment: convertNode(buffer[position + 4], buffer)
1637 };
1638 },
1639 function jsxIdentifier(position, buffer) {
1640 return {
1641 type: 'JSXIdentifier',
1642 start: buffer[position],
1643 end: buffer[position + 1],
1644 name: buffer.convertString(buffer[position + 2])
1645 };
1646 },
1647 function jsxMemberExpression(position, buffer) {
1648 return {
1649 type: 'JSXMemberExpression',
1650 start: buffer[position],
1651 end: buffer[position + 1],
1652 object: convertNode(buffer[position + 2], buffer),
1653 property: convertNode(buffer[position + 3], buffer)
1654 };
1655 },
1656 function jsxNamespacedName(position, buffer) {
1657 return {
1658 type: 'JSXNamespacedName',
1659 start: buffer[position],
1660 end: buffer[position + 1],
1661 namespace: convertNode(buffer[position + 2], buffer),
1662 name: convertNode(buffer[position + 3], buffer)
1663 };
1664 },
1665 function jsxOpeningElement(position, buffer) {
1666 const flags = buffer[position + 2];
1667 return {
1668 type: 'JSXOpeningElement',
1669 start: buffer[position],
1670 end: buffer[position + 1],
1671 selfClosing: (flags & 1) === 1,
1672 name: convertNode(buffer[position + 3], buffer),
1673 attributes: convertNodeList(buffer[position + 4], buffer)
1674 };
1675 },
1676 function jsxOpeningFragment(position, buffer) {
1677 return {
1678 type: 'JSXOpeningFragment',
1679 start: buffer[position],
1680 end: buffer[position + 1],
1681 attributes: [],
1682 selfClosing: false
1683 };
1684 },
1685 function jsxSpreadAttribute(position, buffer) {
1686 return {
1687 type: 'JSXSpreadAttribute',
1688 start: buffer[position],
1689 end: buffer[position + 1],
1690 argument: convertNode(buffer[position + 2], buffer)
1691 };
1692 },
1693 function jsxSpreadChild(position, buffer) {
1694 return {
1695 type: 'JSXSpreadChild',
1696 start: buffer[position],
1697 end: buffer[position + 1],
1698 expression: convertNode(buffer[position + 2], buffer)
1699 };
1700 },
1701 function jsxText(position, buffer) {
1702 return {
1703 type: 'JSXText',
1704 start: buffer[position],
1705 end: buffer[position + 1],
1706 value: buffer.convertString(buffer[position + 2]),
1707 raw: buffer.convertString(buffer[position + 3])
1708 };
1709 },
1710 function labeledStatement(position, buffer) {
1711 return {
1712 type: 'LabeledStatement',
1713 start: buffer[position],
1714 end: buffer[position + 1],
1715 label: convertNode(buffer[position + 2], buffer),
1716 body: convertNode(buffer[position + 3], buffer)
1717 };
1718 },
1719 function literalBigInt(position, buffer) {
1720 const bigint = buffer.convertString(buffer[position + 2]);
1721 return {
1722 type: 'Literal',
1723 start: buffer[position],
1724 end: buffer[position + 1],
1725 bigint,
1726 raw: buffer.convertString(buffer[position + 3]),
1727 value: BigInt(bigint)
1728 };
1729 },
1730 function literalBoolean(position, buffer) {
1731 const flags = buffer[position + 2];
1732 const value = (flags & 1) === 1;
1733 return {
1734 type: 'Literal',
1735 start: buffer[position],
1736 end: buffer[position + 1],
1737 value,
1738 raw: value ? 'true' : 'false'
1739 };
1740 },
1741 function literalNull(position, buffer) {
1742 return {
1743 type: 'Literal',
1744 start: buffer[position],
1745 end: buffer[position + 1],
1746 raw: 'null',
1747 value: null
1748 };
1749 },
1750 function literalNumber(position, buffer) {
1751 const rawPosition = buffer[position + 2];
1752 return {
1753 type: 'Literal',
1754 start: buffer[position],
1755 end: buffer[position + 1],
1756 raw: rawPosition === 0 ? undefined : buffer.convertString(rawPosition),
1757 value: new DataView(buffer.buffer).getFloat64((position + 3) << 2, true)
1758 };
1759 },
1760 function literalRegExp(position, buffer) {
1761 const flags = buffer.convertString(buffer[position + 2]);
1762 const pattern = buffer.convertString(buffer[position + 3]);
1763 return {
1764 type: 'Literal',
1765 start: buffer[position],
1766 end: buffer[position + 1],
1767 raw: `/${pattern}/${flags}`,
1768 regex: { flags, pattern },
1769 value: new RegExp(pattern, flags)
1770 };
1771 },
1772 function literalString(position, buffer) {
1773 const rawPosition = buffer[position + 3];
1774 return {
1775 type: 'Literal',
1776 start: buffer[position],
1777 end: buffer[position + 1],
1778 value: buffer.convertString(buffer[position + 2]),
1779 raw: rawPosition === 0 ? undefined : buffer.convertString(rawPosition)
1780 };
1781 },
1782 function logicalExpression(position, buffer) {
1783 return {
1784 type: 'LogicalExpression',
1785 start: buffer[position],
1786 end: buffer[position + 1],
1787 operator: FIXED_STRINGS[buffer[position + 2]],
1788 left: convertNode(buffer[position + 3], buffer),
1789 right: convertNode(buffer[position + 4], buffer)
1790 };
1791 },
1792 function memberExpression(position, buffer) {
1793 const flags = buffer[position + 2];
1794 return {
1795 type: 'MemberExpression',
1796 start: buffer[position],
1797 end: buffer[position + 1],
1798 computed: (flags & 1) === 1,
1799 optional: (flags & 2) === 2,
1800 object: convertNode(buffer[position + 3], buffer),
1801 property: convertNode(buffer[position + 4], buffer)
1802 };
1803 },
1804 function metaProperty(position, buffer) {
1805 return {
1806 type: 'MetaProperty',
1807 start: buffer[position],
1808 end: buffer[position + 1],
1809 meta: convertNode(buffer[position + 2], buffer),
1810 property: convertNode(buffer[position + 3], buffer)
1811 };
1812 },
1813 function methodDefinition(position, buffer) {
1814 const flags = buffer[position + 2];
1815 return {
1816 type: 'MethodDefinition',
1817 start: buffer[position],
1818 end: buffer[position + 1],
1819 static: (flags & 1) === 1,
1820 computed: (flags & 2) === 2,
1821 decorators: convertNodeList(buffer[position + 3], buffer),
1822 key: convertNode(buffer[position + 4], buffer),
1823 value: convertNode(buffer[position + 5], buffer),
1824 kind: FIXED_STRINGS[buffer[position + 6]]
1825 };
1826 },
1827 function newExpression(position, buffer) {
1828 const annotations = convertAnnotations(buffer[position + 2], buffer);
1829 return {
1830 type: 'NewExpression',
1831 start: buffer[position],
1832 end: buffer[position + 1],
1833 ...(annotations.length > 0 ? { [ANNOTATION_KEY]: annotations } : {}),
1834 callee: convertNode(buffer[position + 3], buffer),
1835 arguments: convertNodeList(buffer[position + 4], buffer)
1836 };
1837 },
1838 function objectExpression(position, buffer) {
1839 return {
1840 type: 'ObjectExpression',
1841 start: buffer[position],
1842 end: buffer[position + 1],
1843 properties: convertNodeList(buffer[position + 2], buffer)
1844 };
1845 },
1846 function objectPattern(position, buffer) {
1847 return {
1848 type: 'ObjectPattern',
1849 start: buffer[position],
1850 end: buffer[position + 1],
1851 properties: convertNodeList(buffer[position + 2], buffer)
1852 };
1853 },
1854 function privateIdentifier(position, buffer) {
1855 return {
1856 type: 'PrivateIdentifier',
1857 start: buffer[position],
1858 end: buffer[position + 1],
1859 name: buffer.convertString(buffer[position + 2])
1860 };
1861 },
1862 function program(position, buffer) {
1863 const invalidAnnotations = convertAnnotations(buffer[position + 3], buffer);
1864 return {
1865 type: 'Program',
1866 start: buffer[position],
1867 end: buffer[position + 1],
1868 body: convertNodeList(buffer[position + 2], buffer),
1869 ...(invalidAnnotations.length > 0 ? { [INVALID_ANNOTATION_KEY]: invalidAnnotations } : {}),
1870 sourceType: 'module'
1871 };
1872 },
1873 function property(position, buffer) {
1874 const flags = buffer[position + 2];
1875 const keyPosition = buffer[position + 3];
1876 const value = convertNode(buffer[position + 4], buffer);
1877 return {
1878 type: 'Property',
1879 start: buffer[position],
1880 end: buffer[position + 1],
1881 method: (flags & 1) === 1,
1882 shorthand: (flags & 2) === 2,
1883 computed: (flags & 4) === 4,
1884 key: keyPosition === 0 ? { ...value } : convertNode(keyPosition, buffer),
1885 value,
1886 kind: FIXED_STRINGS[buffer[position + 5]]
1887 };
1888 },
1889 function propertyDefinition(position, buffer) {
1890 const flags = buffer[position + 2];
1891 const valuePosition = buffer[position + 5];
1892 return {
1893 type: 'PropertyDefinition',
1894 start: buffer[position],
1895 end: buffer[position + 1],
1896 static: (flags & 1) === 1,
1897 computed: (flags & 2) === 2,
1898 decorators: convertNodeList(buffer[position + 3], buffer),
1899 key: convertNode(buffer[position + 4], buffer),
1900 value: valuePosition === 0 ? null : convertNode(valuePosition, buffer)
1901 };
1902 },
1903 function restElement(position, buffer) {
1904 return {
1905 type: 'RestElement',
1906 start: buffer[position],
1907 end: buffer[position + 1],
1908 argument: convertNode(buffer[position + 2], buffer)
1909 };
1910 },
1911 function returnStatement(position, buffer) {
1912 const argumentPosition = buffer[position + 2];
1913 return {
1914 type: 'ReturnStatement',
1915 start: buffer[position],
1916 end: buffer[position + 1],
1917 argument: argumentPosition === 0 ? null : convertNode(argumentPosition, buffer)
1918 };
1919 },
1920 function sequenceExpression(position, buffer) {
1921 return {
1922 type: 'SequenceExpression',
1923 start: buffer[position],
1924 end: buffer[position + 1],
1925 expressions: convertNodeList(buffer[position + 2], buffer)
1926 };
1927 },
1928 function spreadElement(position, buffer) {
1929 return {
1930 type: 'SpreadElement',
1931 start: buffer[position],
1932 end: buffer[position + 1],
1933 argument: convertNode(buffer[position + 2], buffer)
1934 };
1935 },
1936 function staticBlock(position, buffer) {
1937 return {
1938 type: 'StaticBlock',
1939 start: buffer[position],
1940 end: buffer[position + 1],
1941 body: convertNodeList(buffer[position + 2], buffer)
1942 };
1943 },
1944 function superElement(position, buffer) {
1945 return {
1946 type: 'Super',
1947 start: buffer[position],
1948 end: buffer[position + 1]
1949 };
1950 },
1951 function switchCase(position, buffer) {
1952 const testPosition = buffer[position + 2];
1953 return {
1954 type: 'SwitchCase',
1955 start: buffer[position],
1956 end: buffer[position + 1],
1957 test: testPosition === 0 ? null : convertNode(testPosition, buffer),
1958 consequent: convertNodeList(buffer[position + 3], buffer)
1959 };
1960 },
1961 function switchStatement(position, buffer) {
1962 return {
1963 type: 'SwitchStatement',
1964 start: buffer[position],
1965 end: buffer[position + 1],
1966 discriminant: convertNode(buffer[position + 2], buffer),
1967 cases: convertNodeList(buffer[position + 3], buffer)
1968 };
1969 },
1970 function taggedTemplateExpression(position, buffer) {
1971 return {
1972 type: 'TaggedTemplateExpression',
1973 start: buffer[position],
1974 end: buffer[position + 1],
1975 tag: convertNode(buffer[position + 2], buffer),
1976 quasi: convertNode(buffer[position + 3], buffer)
1977 };
1978 },
1979 function templateElement(position, buffer) {
1980 const flags = buffer[position + 2];
1981 const cookedPosition = buffer[position + 3];
1982 const cooked = cookedPosition === 0 ? undefined : buffer.convertString(cookedPosition);
1983 const raw = buffer.convertString(buffer[position + 4]);
1984 return {
1985 type: 'TemplateElement',
1986 start: buffer[position],
1987 end: buffer[position + 1],
1988 tail: (flags & 1) === 1,
1989 value: { cooked, raw }
1990 };
1991 },
1992 function templateLiteral(position, buffer) {
1993 return {
1994 type: 'TemplateLiteral',
1995 start: buffer[position],
1996 end: buffer[position + 1],
1997 quasis: convertNodeList(buffer[position + 2], buffer),
1998 expressions: convertNodeList(buffer[position + 3], buffer)
1999 };
2000 },
2001 function thisExpression(position, buffer) {
2002 return {
2003 type: 'ThisExpression',
2004 start: buffer[position],
2005 end: buffer[position + 1]
2006 };
2007 },
2008 function throwStatement(position, buffer) {
2009 return {
2010 type: 'ThrowStatement',
2011 start: buffer[position],
2012 end: buffer[position + 1],
2013 argument: convertNode(buffer[position + 2], buffer)
2014 };
2015 },
2016 function tryStatement(position, buffer) {
2017 const handlerPosition = buffer[position + 3];
2018 const finalizerPosition = buffer[position + 4];
2019 return {
2020 type: 'TryStatement',
2021 start: buffer[position],
2022 end: buffer[position + 1],
2023 block: convertNode(buffer[position + 2], buffer),
2024 handler: handlerPosition === 0 ? null : convertNode(handlerPosition, buffer),
2025 finalizer: finalizerPosition === 0 ? null : convertNode(finalizerPosition, buffer)
2026 };
2027 },
2028 function unaryExpression(position, buffer) {
2029 return {
2030 type: 'UnaryExpression',
2031 start: buffer[position],
2032 end: buffer[position + 1],
2033 operator: FIXED_STRINGS[buffer[position + 2]],
2034 argument: convertNode(buffer[position + 3], buffer),
2035 prefix: true
2036 };
2037 },
2038 function updateExpression(position, buffer) {
2039 const flags = buffer[position + 2];
2040 return {
2041 type: 'UpdateExpression',
2042 start: buffer[position],
2043 end: buffer[position + 1],
2044 prefix: (flags & 1) === 1,
2045 operator: FIXED_STRINGS[buffer[position + 3]],
2046 argument: convertNode(buffer[position + 4], buffer)
2047 };
2048 },
2049 function variableDeclaration(position, buffer) {
2050 return {
2051 type: 'VariableDeclaration',
2052 start: buffer[position],
2053 end: buffer[position + 1],
2054 kind: FIXED_STRINGS[buffer[position + 2]],
2055 declarations: convertNodeList(buffer[position + 3], buffer)
2056 };
2057 },
2058 function variableDeclarator(position, buffer) {
2059 const initPosition = buffer[position + 3];
2060 return {
2061 type: 'VariableDeclarator',
2062 start: buffer[position],
2063 end: buffer[position + 1],
2064 id: convertNode(buffer[position + 2], buffer),
2065 init: initPosition === 0 ? null : convertNode(initPosition, buffer)
2066 };
2067 },
2068 function whileStatement(position, buffer) {
2069 return {
2070 type: 'WhileStatement',
2071 start: buffer[position],
2072 end: buffer[position + 1],
2073 test: convertNode(buffer[position + 2], buffer),
2074 body: convertNode(buffer[position + 3], buffer)
2075 };
2076 },
2077 function yieldExpression(position, buffer) {
2078 const flags = buffer[position + 2];
2079 const argumentPosition = buffer[position + 3];
2080 return {
2081 type: 'YieldExpression',
2082 start: buffer[position],
2083 end: buffer[position + 1],
2084 delegate: (flags & 1) === 1,
2085 argument: argumentPosition === 0 ? null : convertNode(argumentPosition, buffer)
2086 };
2087 }
2088];
2089function convertNode(position, buffer) {
2090 const nodeType = buffer[position];
2091 const converter = nodeConverters[nodeType];
2092 /* istanbul ignore if: This should never be executed but is a safeguard against faulty buffers */
2093 if (!converter) {
2094 console.trace();
2095 throw new Error(`Unknown node type: ${nodeType}`);
2096 }
2097 return converter(position + 1, buffer);
2098}
2099function convertNodeList(position, buffer) {
2100 if (position === 0)
2101 return EMPTY_ARRAY;
2102 const length = buffer[position++];
2103 const list = new Array(length);
2104 for (let index = 0; index < length; index++) {
2105 const nodePosition = buffer[position++];
2106 list[index] = nodePosition ? convertNode(nodePosition, buffer) : null;
2107 }
2108 return list;
2109}
2110
2111function getAstBuffer(astBuffer) {
2112 const array = new Uint32Array(astBuffer.buffer);
2113 let convertString;
2114 if (typeof Buffer !== 'undefined' && astBuffer instanceof Buffer) {
2115 convertString = (position) => {
2116 const length = array[position++];
2117 const bytePosition = position << 2;
2118 return astBuffer.toString('utf8', bytePosition, bytePosition + length);
2119 };
2120 }
2121 else {
2122 const textDecoder = new TextDecoder();
2123 convertString = (position) => {
2124 const length = array[position++];
2125 const bytePosition = position << 2;
2126 return textDecoder.decode(astBuffer.subarray(bytePosition, bytePosition + length));
2127 };
2128 }
2129 return Object.assign(array, { convertString });
2130}
2131
2132const parseAst = (input, { allowReturnOutsideFunction = false, jsx = false } = {}) => convertProgram(getAstBuffer(native_js.parse(input, allowReturnOutsideFunction, jsx)));
2133const parseAstAsync = async (input, { allowReturnOutsideFunction = false, jsx = false, signal } = {}) => convertProgram(getAstBuffer(await native_js.parseAsync(input, allowReturnOutsideFunction, jsx, signal)));
2134
2135exports.ANNOTATION_KEY = ANNOTATION_KEY;
2136exports.ArrowFunctionExpression = ArrowFunctionExpression;
2137exports.BLANK = BLANK;
2138exports.BlockStatement = BlockStatement;
2139exports.CallExpression = CallExpression;
2140exports.CatchClause = CatchClause;
2141exports.EMPTY_ARRAY = EMPTY_ARRAY;
2142exports.EMPTY_OBJECT = EMPTY_OBJECT;
2143exports.EMPTY_SET = EMPTY_SET;
2144exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
2145exports.ExpressionStatement = ExpressionStatement;
2146exports.FIXED_STRINGS = FIXED_STRINGS;
2147exports.INVALID_ANNOTATION_KEY = INVALID_ANNOTATION_KEY;
2148exports.Identifier = Identifier;
2149exports.LOGLEVEL_DEBUG = LOGLEVEL_DEBUG;
2150exports.LOGLEVEL_ERROR = LOGLEVEL_ERROR;
2151exports.LOGLEVEL_INFO = LOGLEVEL_INFO;
2152exports.LOGLEVEL_WARN = LOGLEVEL_WARN;
2153exports.Literal = Literal;
2154exports.ObjectExpression = ObjectExpression;
2155exports.Program = Program;
2156exports.Property = Property;
2157exports.ReturnStatement = ReturnStatement;
2158exports.StaticBlock = StaticBlock;
2159exports.TemplateLiteral = TemplateLiteral;
2160exports.URL_AVOIDING_EVAL = URL_AVOIDING_EVAL;
2161exports.URL_GENERATEBUNDLE = URL_GENERATEBUNDLE;
2162exports.URL_JSX = URL_JSX;
2163exports.URL_NAME_IS_NOT_EXPORTED = URL_NAME_IS_NOT_EXPORTED;
2164exports.URL_OUTPUT_AMD_BASEPATH = URL_OUTPUT_AMD_BASEPATH;
2165exports.URL_OUTPUT_AMD_ID = URL_OUTPUT_AMD_ID;
2166exports.URL_OUTPUT_DIR = URL_OUTPUT_DIR;
2167exports.URL_OUTPUT_EXPORTS = URL_OUTPUT_EXPORTS;
2168exports.URL_OUTPUT_EXTERNALIMPORTATTRIBUTES = URL_OUTPUT_EXTERNALIMPORTATTRIBUTES;
2169exports.URL_OUTPUT_FORMAT = URL_OUTPUT_FORMAT;
2170exports.URL_OUTPUT_GENERATEDCODE = URL_OUTPUT_GENERATEDCODE;
2171exports.URL_OUTPUT_GLOBALS = URL_OUTPUT_GLOBALS;
2172exports.URL_OUTPUT_INLINEDYNAMICIMPORTS = URL_OUTPUT_INLINEDYNAMICIMPORTS;
2173exports.URL_OUTPUT_INTEROP = URL_OUTPUT_INTEROP;
2174exports.URL_OUTPUT_MANUALCHUNKS = URL_OUTPUT_MANUALCHUNKS;
2175exports.URL_OUTPUT_SOURCEMAPBASEURL = URL_OUTPUT_SOURCEMAPBASEURL;
2176exports.URL_OUTPUT_SOURCEMAPFILE = URL_OUTPUT_SOURCEMAPFILE;
2177exports.URL_PRESERVEENTRYSIGNATURES = URL_PRESERVEENTRYSIGNATURES;
2178exports.URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT = URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT;
2179exports.URL_THIS_IS_UNDEFINED = URL_THIS_IS_UNDEFINED;
2180exports.URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY = URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY;
2181exports.URL_TREESHAKE = URL_TREESHAKE;
2182exports.URL_TREESHAKE_MODULESIDEEFFECTS = URL_TREESHAKE_MODULESIDEEFFECTS;
2183exports.URL_WATCH = URL_WATCH;
2184exports.VariableDeclarator = VariableDeclarator;
2185exports.addTrailingSlashIfMissed = addTrailingSlashIfMissed;
2186exports.augmentCodeLocation = augmentCodeLocation;
2187exports.augmentLogMessage = augmentLogMessage;
2188exports.convertAnnotations = convertAnnotations;
2189exports.convertNode = convertNode;
2190exports.error = error;
2191exports.getAliasName = getAliasName;
2192exports.getAstBuffer = getAstBuffer;
2193exports.getImportPath = getImportPath;
2194exports.getRollupError = getRollupError;
2195exports.getRollupUrl = getRollupUrl;
2196exports.isAbsolute = isAbsolute;
2197exports.isPathFragment = isPathFragment;
2198exports.isRelative = isRelative;
2199exports.isValidUrl = isValidUrl;
2200exports.locate = locate;
2201exports.logAddonNotGenerated = logAddonNotGenerated;
2202exports.logAlreadyClosed = logAlreadyClosed;
2203exports.logAmbiguousExternalNamespaces = logAmbiguousExternalNamespaces;
2204exports.logAnonymousPluginCache = logAnonymousPluginCache;
2205exports.logAssetNotFinalisedForFileName = logAssetNotFinalisedForFileName;
2206exports.logAssetReferenceIdNotFoundForSetSource = logAssetReferenceIdNotFoundForSetSource;
2207exports.logAssetSourceAlreadySet = logAssetSourceAlreadySet;
2208exports.logBadLoader = logBadLoader;
2209exports.logCannotAssignModuleToChunk = logCannotAssignModuleToChunk;
2210exports.logCannotBundleConfigAsEsm = logCannotBundleConfigAsEsm;
2211exports.logCannotCallNamespace = logCannotCallNamespace;
2212exports.logCannotEmitFromOptionsHook = logCannotEmitFromOptionsHook;
2213exports.logCannotLoadConfigAsCjs = logCannotLoadConfigAsCjs;
2214exports.logCannotLoadConfigAsEsm = logCannotLoadConfigAsEsm;
2215exports.logChunkInvalid = logChunkInvalid;
2216exports.logChunkNotGeneratedForFileName = logChunkNotGeneratedForFileName;
2217exports.logCircularDependency = logCircularDependency;
2218exports.logCircularReexport = logCircularReexport;
2219exports.logConflictingSourcemapSources = logConflictingSourcemapSources;
2220exports.logConstVariableReassignError = logConstVariableReassignError;
2221exports.logCyclicCrossChunkReexport = logCyclicCrossChunkReexport;
2222exports.logDuplicateArgumentNameError = logDuplicateArgumentNameError;
2223exports.logDuplicateExportError = logDuplicateExportError;
2224exports.logDuplicateImportOptions = logDuplicateImportOptions;
2225exports.logDuplicatePluginName = logDuplicatePluginName;
2226exports.logEmptyChunk = logEmptyChunk;
2227exports.logEntryCannotBeExternal = logEntryCannotBeExternal;
2228exports.logEval = logEval;
2229exports.logExternalModulesCannotBeIncludedInManualChunks = logExternalModulesCannotBeIncludedInManualChunks;
2230exports.logExternalModulesCannotBeTransformedToModules = logExternalModulesCannotBeTransformedToModules;
2231exports.logExternalSyntheticExports = logExternalSyntheticExports;
2232exports.logFailAfterWarnings = logFailAfterWarnings;
2233exports.logFailedValidation = logFailedValidation;
2234exports.logFileNameConflict = logFileNameConflict;
2235exports.logFileReferenceIdNotFoundForFilename = logFileReferenceIdNotFoundForFilename;
2236exports.logFirstSideEffect = logFirstSideEffect;
2237exports.logIllegalIdentifierAsName = logIllegalIdentifierAsName;
2238exports.logIllegalImportReassignment = logIllegalImportReassignment;
2239exports.logImplicitDependantCannotBeExternal = logImplicitDependantCannotBeExternal;
2240exports.logImplicitDependantIsNotIncluded = logImplicitDependantIsNotIncluded;
2241exports.logImportAttributeIsInvalid = logImportAttributeIsInvalid;
2242exports.logImportOptionsAreInvalid = logImportOptionsAreInvalid;
2243exports.logIncompatibleExportOptionValue = logIncompatibleExportOptionValue;
2244exports.logInconsistentImportAttributes = logInconsistentImportAttributes;
2245exports.logInputHookInOutputPlugin = logInputHookInOutputPlugin;
2246exports.logInternalIdCannotBeExternal = logInternalIdCannotBeExternal;
2247exports.logInvalidAddonPluginHook = logInvalidAddonPluginHook;
2248exports.logInvalidAnnotation = logInvalidAnnotation;
2249exports.logInvalidExportOptionValue = logInvalidExportOptionValue;
2250exports.logInvalidFormatForTopLevelAwait = logInvalidFormatForTopLevelAwait;
2251exports.logInvalidFunctionPluginHook = logInvalidFunctionPluginHook;
2252exports.logInvalidLogPosition = logInvalidLogPosition;
2253exports.logInvalidOption = logInvalidOption;
2254exports.logInvalidRollupPhaseForChunkEmission = logInvalidRollupPhaseForChunkEmission;
2255exports.logInvalidSetAssetSourceCall = logInvalidSetAssetSourceCall;
2256exports.logInvalidSourcemapForError = logInvalidSourcemapForError;
2257exports.logLevelPriority = logLevelPriority;
2258exports.logMissingConfig = logMissingConfig;
2259exports.logMissingEntryExport = logMissingEntryExport;
2260exports.logMissingExport = logMissingExport;
2261exports.logMissingExternalConfig = logMissingExternalConfig;
2262exports.logMissingFileOrDirOption = logMissingFileOrDirOption;
2263exports.logMissingGlobalName = logMissingGlobalName;
2264exports.logMissingJsxExport = logMissingJsxExport;
2265exports.logMissingNameOptionForIifeExport = logMissingNameOptionForIifeExport;
2266exports.logMissingNameOptionForUmdExport = logMissingNameOptionForUmdExport;
2267exports.logMissingNodeBuiltins = logMissingNodeBuiltins;
2268exports.logMixedExport = logMixedExport;
2269exports.logModuleLevelDirective = logModuleLevelDirective;
2270exports.logModuleParseError = logModuleParseError;
2271exports.logNamespaceConflict = logNamespaceConflict;
2272exports.logNoAssetSourceSet = logNoAssetSourceSet;
2273exports.logNoTransformMapOrAstWithoutCode = logNoTransformMapOrAstWithoutCode;
2274exports.logOnlyInlineSourcemapsForStdout = logOnlyInlineSourcemapsForStdout;
2275exports.logOptimizeChunkStatus = logOptimizeChunkStatus;
2276exports.logParseError = logParseError;
2277exports.logPluginError = logPluginError;
2278exports.logRedeclarationError = logRedeclarationError;
2279exports.logReservedNamespace = logReservedNamespace;
2280exports.logShimmedExport = logShimmedExport;
2281exports.logSourcemapBroken = logSourcemapBroken;
2282exports.logSyntheticNamedExportsNeedNamespaceExport = logSyntheticNamedExportsNeedNamespaceExport;
2283exports.logThisIsUndefined = logThisIsUndefined;
2284exports.logUnexpectedNamedImport = logUnexpectedNamedImport;
2285exports.logUnexpectedNamespaceReexport = logUnexpectedNamespaceReexport;
2286exports.logUnknownOption = logUnknownOption;
2287exports.logUnresolvedEntry = logUnresolvedEntry;
2288exports.logUnresolvedImplicitDependant = logUnresolvedImplicitDependant;
2289exports.logUnresolvedImport = logUnresolvedImport;
2290exports.logUnresolvedImportTreatedAsExternal = logUnresolvedImportTreatedAsExternal;
2291exports.logUnusedExternalImports = logUnusedExternalImports;
2292exports.normalize = normalize;
2293exports.parseAst = parseAst;
2294exports.parseAstAsync = parseAstAsync;
2295exports.printQuotedStringList = printQuotedStringList;
2296exports.relative = relative;
2297exports.relativeId = relativeId;
2298exports.warnDeprecation = warnDeprecation;
2299//# sourceMappingURL=parseAst.js.map
Note: See TracBrowser for help on using the repository browser.