Skip to content

Commit 875074a

Browse files
authored
Merge pull request webpack#5936 from webpack/refactor/code-style
Update code style to arrow functions
2 parents f58b66a + 75f68a2 commit 875074a

83 files changed

Lines changed: 961 additions & 1603 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/BasicEvaluatedExpression.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class BasicEvaluatedExpression {
189189
if(!this.options) this.options = [];
190190
options.forEach(item => {
191191
this.options.push(item);
192-
}, this);
192+
});
193193
return this;
194194
}
195195

lib/CachePlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class CachePlugin {
6565
callback();
6666
});
6767
});
68-
compiler.plugin("after-compile", function(compilation, callback) {
68+
compiler.plugin("after-compile", (compilation, callback) => {
6969
compilation.compiler._lastCompilationFileDependencies = compilation.fileDependencies;
7070
compilation.compiler._lastCompilationContextDependencies = compilation.contextDependencies;
7171
callback();

lib/Chunk.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ class Chunk {
501501
const chunksProcessed = [];
502502
const chunkHashMap = {};
503503
const chunkNameMap = {};
504-
(function addChunk(chunk) {
504+
const addChunk = chunk => {
505505
if(chunksProcessed.indexOf(chunk) >= 0) return;
506506
chunksProcessed.push(chunk);
507507
if(!chunk.hasRuntime() || includeEntries) {
@@ -510,7 +510,8 @@ class Chunk {
510510
chunkNameMap[chunk.id] = chunk.name;
511511
}
512512
chunk._chunks.forEach(addChunk);
513-
}(this));
513+
};
514+
addChunk(this);
514515
return {
515516
hash: chunkHashMap,
516517
name: chunkNameMap

0 commit comments

Comments
 (0)