You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 12bd33f
Browse filesBrowse the repository at this point in the historyBrowse files
* The options webpack's parser reads a source as `sourceType` with.
20769
20770
* @param {JavascriptSourceType=} sourceType what the source is, a module where not given
20770
20771
* @returns {{ sourceType: "module" | "script" | "commonjs", allowHashBang: boolean }} acorn's goal, `commonjs` reading a program as a function's body, and whether a `#!` line opens it
* @typedef {object} JavascriptProcessOptions what the JavaScript `SourceProcessor` reads its source as, and prints it with
20782
-
* @property {JavascriptSourceType=} sourceType what the source is: a module (the default), a script, or an event handler's function body
20785
+
* @property {JavascriptSourceType=} sourceType what the source is: a module (the default), a script, or a function's body, a CommonJS module's or an event handler's
20783
20786
* @property {Partial<import("./syntax-printer").FormatSettings>=} format terser's format options a print reads, as `minify` reads them under `format`; `comments`, `beautify` and `source_map` are not read yet
* @property {JavascriptSourceType=} sourceType what the source is: a module (the default), a script, or an event handler's function body
21192
+
* @property {JavascriptSourceType=} sourceType what the source is: a module (the default), a script, or a function's body, a CommonJS module's or an event handler's
21190
21193
* @property {((input: string, code: string, start: number, end: number, severity: ParseErrorSeverity) => void)=} parseError optional callback for each parse error, with the CSS and HTML parsers' signature and Babel's `reasonCode` kebab-cased as `code`; `severity` is `"error"` for one that stops the parse and `"warning"` for one it reads past; without it, the errors read past go unreported
* @property {boolean} safari10 whether the output works around that engine
9293
9297
* @property {false | DriverSourceMapOptions} sourceMap how a source map is written, false for none
9294
-
* @property {JavascriptSourceType | undefined} sourceType which production the source is: a module, a script, or an event handler's function body
9298
+
* @property {JavascriptSourceType | undefined} sourceType which production the source is: a module, a script, or a function's body, a CommonJS module's or an event handler's
9295
9299
* @property {boolean} spidermonkey whether the sources are ESTree trees
9296
9300
* @property {boolean} timings whether how long each step took is answered
9297
9301
* @property {boolean} toplevel whether top-level names may be renamed or dropped
throw new JSParseError(message, filename, line, col, pos);
13330
13337
};
13331
13338
13332
-
/** @typedef {{ bare_returns?: boolean, ecma?: number | null, filename?: string | null, html5_comments?: boolean, module?: boolean, shebang?: boolean, toplevel?: Node | null, [PARSE_ONTO_TABLES]?: TokenTables, [PARSE_FUNCTION_BODY]?: boolean }} ParseOptions terser's parse options, the tables a parse joining a tree numbers its tokens after, and whether the source is a function's body */
13339
+
/** @typedef {{ bare_returns?: boolean, ecma?: number | null, filename?: string | null, html5_comments?: boolean, module?: boolean, shebang?: boolean, toplevel?: Node | null, [PARSE_ONTO_TABLES]?: TokenTables, [PARSE_FUNCTION_BODY]?: "commonjs" | "event-handler" }} ParseOptions terser's parse options, the tables a parse joining a tree numbers its tokens after, and whether the source is a function's body */
13333
13340
13334
13341
/**
13335
13342
* What the parse phase shares with the rest: the operator precedences and
@@ -17858,8 +17865,9 @@ const NO_TOKEN_TABLES = new TokenTables();
17858
17865
// join that tree: its tokens are numbered after the tree's own.
17859
17866
const PARSE_ONTO_TABLES = Symbol("tables a parse numbers its tokens after");
17860
17867
17861
-
// The parse option reading a source as a function's body, as an event handler
17862
-
// attribute's is: `return` and `new.target` at its top, no `#!` line.
17868
+
// The parse option reading a source as a function's body, the `sourceType`
17869
+
// naming whose: `return` and `new.target` at its top, and a `#!` line opening
17870
+
// only a CommonJS module's.
17863
17871
const PARSE_FUNCTION_BODY = Symbol("a source read as a function body");
* optional callback for each parse error, with the CSS and HTML parsers' signature and Babel's `reasonCode` kebab-cased as `code`; `severity` is `"error"` for one that stops the parse and `"warning"` for one it reads past; without it, the errors read past go unreported
@@ -17906,9 +17906,9 @@ type JavascriptParserState = ParserStateBase<BuiltJavascriptModule> &
17906
17906
*/
17907
17907
declare interface JavascriptProcessOptions {
17908
17908
/**
17909
-
* what the source is: a module (the default), a script, or an event handler's function body
17909
+
* what the source is: a module (the default), a script, or a function's body, a CommonJS module's or an event handler's
0 commit comments