pretty files

This commit is contained in:
Tobias Koppers 2019-06-09 11:23:42 +02:00
parent 096c0f0027
commit fd4b3c503a
17 changed files with 33 additions and 95 deletions

2
declarations.d.ts vendored
View File

@ -59,7 +59,7 @@ declare module "neo-async" {
} }
export type AsyncAutoTasks<R extends Dictionary<any>, E> = { export type AsyncAutoTasks<R extends Dictionary<any>, E> = {
[K in keyof R]: AsyncAutoTask<R[K], R, E> [K in keyof R]: AsyncAutoTask<R[K], R, E>;
}; };
export type AsyncAutoTask<R1, R extends Dictionary<any>, E> = export type AsyncAutoTask<R1, R extends Dictionary<any>, E> =
| AsyncAutoTaskFunctionWithoutDependencies<R1, E> | AsyncAutoTaskFunctionWithoutDependencies<R1, E>

View File

@ -496,18 +496,14 @@ class ChunkGroup {
for (const child of chunk._children) { for (const child of chunk._children) {
if (!child._parents.has(chunk)) { if (!child._parents.has(chunk)) {
throw new Error( throw new Error(
`checkConstraints: child missing parent ${chunk.debugId} -> ${ `checkConstraints: child missing parent ${chunk.debugId} -> ${child.debugId}`
child.debugId
}`
); );
} }
} }
for (const parentChunk of chunk._parents) { for (const parentChunk of chunk._parents) {
if (!parentChunk._children.has(chunk)) { if (!parentChunk._children.has(chunk)) {
throw new Error( throw new Error(
`checkConstraints: parent missing child ${parentChunk.debugId} <- ${ `checkConstraints: parent missing child ${parentChunk.debugId} <- ${chunk.debugId}`
chunk.debugId
}`
); );
} }
} }

View File

@ -694,9 +694,7 @@ class Compilation extends Tapable {
const factory = this.dependencyFactories.get(dep.constructor); const factory = this.dependencyFactories.get(dep.constructor);
if (factory === undefined) { if (factory === undefined) {
throw new Error( throw new Error(
`No module factory available for dependency type: ${ `No module factory available for dependency type: ${dep.constructor.name}`
dep.constructor.name
}`
); );
} }
let innerMap = dependencies.get(factory); let innerMap = dependencies.get(factory);
@ -958,9 +956,7 @@ class Compilation extends Tapable {
const moduleFactory = this.dependencyFactories.get(Dep); const moduleFactory = this.dependencyFactories.get(Dep);
if (!moduleFactory) { if (!moduleFactory) {
throw new Error( throw new Error(
`No dependency factory available for this dependency type: ${ `No dependency factory available for this dependency type: ${dependency.constructor.name}`
dependency.constructor.name
}`
); );
} }

View File

@ -345,9 +345,7 @@ module.exports = class MainTemplate extends Tapable {
buf.push(""); buf.push("");
buf.push("// Object.prototype.hasOwnProperty.call"); buf.push("// Object.prototype.hasOwnProperty.call");
buf.push( buf.push(
`${ `${this.requireFn}.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };`
this.requireFn
}.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };`
); );
const publicPath = this.getPublicPath({ const publicPath = this.getPublicPath({

View File

@ -435,9 +435,7 @@ class NormalModuleFactory extends Tapable {
err.message + err.message +
"\n" + "\n" +
"BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.\n" + "BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.\n" +
` You need to specify '${ ` You need to specify '${item.loader}-loader' instead of '${item.loader}',\n` +
item.loader
}-loader' instead of '${item.loader}',\n` +
" see https://webpack.js.org/migrate/3/#automatic-loader-module-name-extension-removed"; " see https://webpack.js.org/migrate/3/#automatic-loader-module-name-extension-removed";
} }
callback(err); callback(err);

View File

@ -382,9 +382,7 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
// We are sure that it's not provided // We are sure that it's not provided
const idIsNotNameMessage = const idIsNotNameMessage =
this._id !== this.name ? ` (reexported as '${this.name}')` : ""; this._id !== this.name ? ` (reexported as '${this.name}')` : "";
const errorMessage = `"export '${ const errorMessage = `"export '${this._id}'${idIsNotNameMessage} was not found in '${this.userRequest}'`;
this._id
}'${idIsNotNameMessage} was not found in '${this.userRequest}'`;
return [new HarmonyLinkingError(errorMessage)]; return [new HarmonyLinkingError(errorMessage)];
} }

View File

@ -107,9 +107,7 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
// We are sure that it's not provided // We are sure that it's not provided
const idIsNotNameMessage = const idIsNotNameMessage =
this._id !== this.name ? ` (imported as '${this.name}')` : ""; this._id !== this.name ? ` (imported as '${this.name}')` : "";
const errorMessage = `"export '${ const errorMessage = `"export '${this._id}'${idIsNotNameMessage} was not found in '${this.userRequest}'`;
this._id
}'${idIsNotNameMessage} was not found in '${this.userRequest}'`;
return [new HarmonyLinkingError(errorMessage)]; return [new HarmonyLinkingError(errorMessage)];
} }

View File

@ -43,9 +43,7 @@ class ImportParserPlugin {
const { comment } = e; const { comment } = e;
parser.state.module.warnings.push( parser.state.module.warnings.push(
new CommentCompilationWarning( new CommentCompilationWarning(
`Compilation error while processing magic comment(-s): /*${ `Compilation error while processing magic comment(-s): /*${comment.value}*/: ${e.message}`,
comment.value
}*/: ${e.message}`,
parser.state.module, parser.state.module,
comment.loc comment.loc
) )
@ -59,9 +57,7 @@ class ImportParserPlugin {
parser.state.module.warnings.push( parser.state.module.warnings.push(
new UnsupportedFeatureWarning( new UnsupportedFeatureWarning(
parser.state.module, parser.state.module,
`\`webpackIgnore\` expected a boolean, but received: ${ `\`webpackIgnore\` expected a boolean, but received: ${importOptions.webpackIgnore}.`,
importOptions.webpackIgnore
}.`,
expr.loc expr.loc
) )
); );
@ -77,9 +73,7 @@ class ImportParserPlugin {
parser.state.module.warnings.push( parser.state.module.warnings.push(
new UnsupportedFeatureWarning( new UnsupportedFeatureWarning(
parser.state.module, parser.state.module,
`\`webpackChunkName\` expected a string, but received: ${ `\`webpackChunkName\` expected a string, but received: ${importOptions.webpackChunkName}.`,
importOptions.webpackChunkName
}.`,
expr.loc expr.loc
) )
); );
@ -92,9 +86,7 @@ class ImportParserPlugin {
parser.state.module.warnings.push( parser.state.module.warnings.push(
new UnsupportedFeatureWarning( new UnsupportedFeatureWarning(
parser.state.module, parser.state.module,
`\`webpackMode\` expected a string, but received: ${ `\`webpackMode\` expected a string, but received: ${importOptions.webpackMode}.`,
importOptions.webpackMode
}.`,
expr.loc expr.loc
) )
); );
@ -111,9 +103,7 @@ class ImportParserPlugin {
parser.state.module.warnings.push( parser.state.module.warnings.push(
new UnsupportedFeatureWarning( new UnsupportedFeatureWarning(
parser.state.module, parser.state.module,
`\`webpackPrefetch\` expected true or a number, but received: ${ `\`webpackPrefetch\` expected true or a number, but received: ${importOptions.webpackPrefetch}.`,
importOptions.webpackPrefetch
}.`,
expr.loc expr.loc
) )
); );
@ -128,9 +118,7 @@ class ImportParserPlugin {
parser.state.module.warnings.push( parser.state.module.warnings.push(
new UnsupportedFeatureWarning( new UnsupportedFeatureWarning(
parser.state.module, parser.state.module,
`\`webpackPreload\` expected true or a number, but received: ${ `\`webpackPreload\` expected true or a number, but received: ${importOptions.webpackPreload}.`,
importOptions.webpackPreload
}.`,
expr.loc expr.loc
) )
); );
@ -144,9 +132,7 @@ class ImportParserPlugin {
parser.state.module.warnings.push( parser.state.module.warnings.push(
new UnsupportedFeatureWarning( new UnsupportedFeatureWarning(
parser.state.module, parser.state.module,
`\`webpackInclude\` expected a regular expression, but received: ${ `\`webpackInclude\` expected a regular expression, but received: ${importOptions.webpackInclude}.`,
importOptions.webpackInclude
}.`,
expr.loc expr.loc
) )
); );
@ -162,9 +148,7 @@ class ImportParserPlugin {
parser.state.module.warnings.push( parser.state.module.warnings.push(
new UnsupportedFeatureWarning( new UnsupportedFeatureWarning(
parser.state.module, parser.state.module,
`\`webpackExclude\` expected a regular expression, but received: ${ `\`webpackExclude\` expected a regular expression, but received: ${importOptions.webpackExclude}.`,
importOptions.webpackExclude
}.`,
expr.loc expr.loc
) )
); );

View File

@ -49,9 +49,7 @@ class LoaderPlugin {
if (factory === undefined) { if (factory === undefined) {
return callback( return callback(
new Error( new Error(
`No module factory available for dependency type: ${ `No module factory available for dependency type: ${dep.constructor.name}`
dep.constructor.name
}`
) )
); );
} }

View File

@ -40,9 +40,7 @@ class WebAssemblyImportDependency extends ModuleDependency {
) { ) {
return [ return [
new UnsupportedWebAssemblyFeatureError( new UnsupportedWebAssemblyFeatureError(
`Import "${this.name}" from "${this.request}" with ${ `Import "${this.name}" from "${this.request}" with ${this.onlyDirectImport} can only be used for direct wasm to wasm dependencies`
this.onlyDirectImport
} can only be used for direct wasm to wasm dependencies`
) )
]; ];
} }

View File

@ -26,9 +26,7 @@ class ChunkModuleIdRangePlugin {
); );
if (!chunk) { if (!chunk) {
throw new Error( throw new Error(
`ChunkModuleIdRangePlugin: Chunk with name '${ `ChunkModuleIdRangePlugin: Chunk with name '${options.name}"' was not found`
options.name
}"' was not found`
); );
} }

View File

@ -1136,23 +1136,17 @@ class ConcatenatedModule extends Module {
if (info.interopNamespaceObjectUsed) { if (info.interopNamespaceObjectUsed) {
if (info.module.buildMeta.exportsType === "named") { if (info.module.buildMeta.exportsType === "named") {
result.add( result.add(
`var ${ `var ${info.interopNamespaceObjectName} = /*#__PURE__*/__webpack_require__.t(${info.name}, 2);\n`
info.interopNamespaceObjectName
} = /*#__PURE__*/__webpack_require__.t(${info.name}, 2);\n`
); );
} else if (!info.module.buildMeta.exportsType) { } else if (!info.module.buildMeta.exportsType) {
result.add( result.add(
`var ${ `var ${info.interopNamespaceObjectName} = /*#__PURE__*/__webpack_require__.t(${info.name});\n`
info.interopNamespaceObjectName
} = /*#__PURE__*/__webpack_require__.t(${info.name});\n`
); );
} }
} }
if (info.interopDefaultAccessUsed) { if (info.interopDefaultAccessUsed) {
result.add( result.add(
`var ${ `var ${info.interopDefaultAccessName} = /*#__PURE__*/__webpack_require__.n(${info.name});\n`
info.interopDefaultAccessName
} = /*#__PURE__*/__webpack_require__.n(${info.name});\n`
); );
} }
break; break;
@ -1266,9 +1260,7 @@ class HarmonyImportSpecifierDependencyConcatenatedTemplate {
}_ns${strictFlag}__[${JSON.stringify(dep._id)}]`; }_ns${strictFlag}__[${JSON.stringify(dep._id)}]`;
} else { } else {
const exportData = Buffer.from(dep._id, "utf-8").toString("hex"); const exportData = Buffer.from(dep._id, "utf-8").toString("hex");
content = `__WEBPACK_MODULE_REFERENCE__${ content = `__WEBPACK_MODULE_REFERENCE__${info.index}_${exportData}${callFlag}${strictFlag}__`;
info.index
}_${exportData}${callFlag}${strictFlag}__`;
} }
if (dep.shorthand) { if (dep.shorthand) {
content = dep.name + ": " + content; content = dep.name + ": " + content;
@ -1464,14 +1456,10 @@ class HarmonyExportImportedSpecifierDependencyConcatenatedTemplate {
? "_strict" ? "_strict"
: ""; : "";
if (def.id === true) { if (def.id === true) {
finalName = `__WEBPACK_MODULE_REFERENCE__${ finalName = `__WEBPACK_MODULE_REFERENCE__${info.index}_ns${strictFlag}__`;
info.index
}_ns${strictFlag}__`;
} else { } else {
const exportData = Buffer.from(def.id, "utf-8").toString("hex"); const exportData = Buffer.from(def.id, "utf-8").toString("hex");
finalName = `__WEBPACK_MODULE_REFERENCE__${ finalName = `__WEBPACK_MODULE_REFERENCE__${info.index}_${exportData}${strictFlag}__`;
info.index
}_${exportData}${strictFlag}__`;
} }
const exportsName = this.rootModule.exportsArgument; const exportsName = this.rootModule.exportsArgument;
const content = const content =

View File

@ -46,9 +46,7 @@ class WasmFinalizeExportsPlugin {
// 4. error // 4. error
/** @type {any} */ /** @type {any} */
const error = new UnsupportedWebAssemblyFeatureError( const error = new UnsupportedWebAssemblyFeatureError(
`Export "${name}" with ${ `Export "${name}" with ${jsIncompatibleExports[name]} can only be used for direct wasm to wasm dependencies`
jsIncompatibleExports[name]
} can only be used for direct wasm to wasm dependencies`
); );
error.module = module; error.module = module;
error.origin = reason.module; error.origin = reason.module;

View File

@ -307,9 +307,7 @@ class WasmMainTemplatePlugin {
"}", "}",
"promises.push(installedWasmModules[wasmModuleId] = promise.then(function(res) {", "promises.push(installedWasmModules[wasmModuleId] = promise.then(function(res) {",
Template.indent([ Template.indent([
`return ${ `return ${mainTemplate.requireFn}.w[wasmModuleId] = (res.instance || res).exports;`
mainTemplate.requireFn
}.w[wasmModuleId] = (res.instance || res).exports;`
]), ]),
"}));" "}));"
]), ]),

View File

@ -340,9 +340,7 @@ class JsonpMainTemplatePlugin {
source, source,
"", "",
"// on error function for async loading", "// on error function for async loading",
`${ `${mainTemplate.requireFn}.oe = function(err) { console.error(err); throw err; };`
mainTemplate.requireFn
}.oe = function(err) { console.error(err); throw err; };`
]); ]);
} }
); );

View File

@ -505,7 +505,7 @@ rules:
context: "licence/cla" context: "licence/cla"
description: "Contributor License Agreement is not needed for this user." description: "Contributor License Agreement is not needed for this user."
state: "success" state: "success"
# merge dependabot PRs automatically # merge dependabot PRs automatically
- filters: - filters:
open: true open: true

View File

@ -279,9 +279,7 @@ describe("BenchmarkTestCases", function() {
describe(`${testName} create benchmarks`, function() { describe(`${testName} create benchmarks`, function() {
baselines.forEach(baseline => { baselines.forEach(baseline => {
let baselineStats = null; let baselineStats = null;
it(`should benchmark ${baseline.name} (${ it(`should benchmark ${baseline.name} (${baseline.rev})`, function(done) {
baseline.rev
})`, function(done) {
const outputDirectory = path.join( const outputDirectory = path.join(
__dirname, __dirname,
"js", "js",
@ -332,14 +330,10 @@ describe("BenchmarkTestCases", function() {
}, 180000); }, 180000);
if (baseline.name !== "HEAD") { if (baseline.name !== "HEAD") {
it(`HEAD should not be slower than ${baseline.name} (${ it(`HEAD should not be slower than ${baseline.name} (${baseline.rev})`, function() {
baseline.rev
})`, function() {
if (baselineStats.maxConfidence < headStats.minConfidence) { if (baselineStats.maxConfidence < headStats.minConfidence) {
throw new Error( throw new Error(
`HEAD (${headStats.text}) is slower than ${baseline.name} (${ `HEAD (${headStats.text}) is slower than ${baseline.name} (${baselineStats.text}) (90% confidence)`
baselineStats.text
}) (90% confidence)`
); );
} else if ( } else if (
baselineStats.minConfidence > headStats.maxConfidence baselineStats.minConfidence > headStats.maxConfidence