Skip to content

Commit 5b236b9

Browse files
author
Ritik Rishu
committed
replacing Object.defineProperty with es6 get/set
1 parent 2c32b08 commit 5b236b9

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

‎lib/AsyncDependenciesBlock.js‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@ module.exports = class AsyncDependenciesBlock extends DependenciesBlock {
1212
this.chunks = null;
1313
this.module = module;
1414
this.loc = loc;
15-
16-
Object.defineProperty(this, "chunk", {
17-
get: function() {
18-
throw new Error("`chunk` was been renamed to `chunks` and is now an array");
19-
},
20-
set: function() {
21-
throw new Error("`chunk` was been renamed to `chunks` and is now an array");
22-
}
23-
});
15+
}
16+
get chunk() {
17+
throw new Error("`chunk` was been renamed to `chunks` and is now an array");
18+
}
19+
set chunk(chunk) {
20+
throw new Error("`chunk` was been renamed to `chunks` and is now an array");
2421
}
2522
updateHash(hash) {
2623
hash.update(this.chunkName || "");

0 commit comments

Comments
 (0)