Skip to content

Commit 9687015

Browse files
committed
refactor(ES6): upgrade LocalModule to ES6
1 parent f745f02 commit 9687015

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

lib/dependencies/LocalModule.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@
22
MIT License http://www.opensource.org/licenses/mit-license.php
33
Author Tobias Koppers @sokra
44
*/
5-
function LocalModule(module, name, idx) {
6-
this.module = module;
7-
this.name = name;
8-
this.idx = idx;
9-
this.used = false;
10-
}
11-
module.exports = LocalModule;
5+
"use strict";
6+
7+
class LocalModule {
8+
constructor(module, name, idx) {
9+
this.module = module;
10+
this.name = name;
11+
this.idx = idx;
12+
this.used = false;
13+
}
1214

13-
LocalModule.prototype.flagUsed = function() {
14-
this.used = true;
15-
};
15+
flagUsed() {
16+
this.used = true;
17+
}
1618

17-
LocalModule.prototype.variableName = function() {
18-
return "__WEBPACK_LOCAL_MODULE_" + this.idx + "__";
19-
};
19+
variableName() {
20+
return "__WEBPACK_LOCAL_MODULE_" + this.idx + "__";
21+
}
22+
}
23+
module.exports = LocalModule;

0 commit comments

Comments
 (0)