Skip to content

Commit 53711d5

Browse files
committed
make deprecations more yelling
1 parent 6bd937d commit 53711d5

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

lib/Chunk.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ class Chunk {
481481
Object.defineProperty(Chunk.prototype, "modules", {
482482
configurable: false,
483483
get: util.deprecate(function() {
484-
return Array.from(this._modules);
484+
return this._modules.getFrozenArray();
485485
}, "Chunk.modules is deprecated. Use Chunk.getNumberOfModules/mapModules/forEachModule/containsModule instead."),
486486
set: util.deprecate(function(value) {
487487
this.setModules(value);

lib/Module.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ class Module extends DependenciesBlock {
129129
return this._chunks.size;
130130
}
131131

132+
get chunksIterable() {
133+
return this._chunks;
134+
}
135+
132136
hasEqualsChunks(otherModule) {
133137
if(this._chunks.size !== otherModule._chunks.size) return false;
134138
this._chunks.sortWith(sortByDebugId);
@@ -233,7 +237,7 @@ Object.defineProperty(Module.prototype, "entry", {
233237
Object.defineProperty(Module.prototype, "chunks", {
234238
configurable: false,
235239
get: util.deprecate(function() {
236-
return Array.from(this._chunks);
240+
return this._chunks.getFrozenArray();
237241
}, "Module.chunks: Use Module.forEachChunk/mapChunks/getNumberOfChunks/isInChunk/addChunk/removeChunk instead"),
238242
set() {
239243
throw new Error("Readonly. Use Module.addChunk/removeChunk to modify chunks.");

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@
8989
"schemas/"
9090
],
9191
"scripts": {
92-
"test": "mocha test/*.test.js --max-old-space-size=4096 --harmony --check-leaks",
92+
"test": "mocha test/*.test.js --max-old-space-size=4096 --harmony --trace-deprecation --check-leaks",
9393
"travis:test": "npm run cover:min",
9494
"travis:lint": "npm run lint-files && npm run nsp",
9595
"travis:benchmark": "npm run benchmark",
96-
"appveyor:test": "node node_modules\\mocha\\bin\\mocha --max-old-space-size=4096 --harmony test/*.test.js",
96+
"appveyor:test": "node node_modules\\mocha\\bin\\mocha --max-old-space-size=4096 --harmony --trace-deprecation test/*.test.js",
9797
"appveyor:benchmark": "npm run benchmark",
98-
"circleci:test": "node node_modules/mocha/bin/mocha --max-old-space-size=4096 --harmony test/*.test.js",
98+
"circleci:test": "node node_modules/mocha/bin/mocha --max-old-space-size=4096 --harmony --trace-deprecation test/*.test.js",
9999
"circleci:lint": "npm run lint-files && npm run nsp",
100100
"build:examples": "cd examples && node buildAll.js",
101101
"pretest": "npm run lint-files",
@@ -104,9 +104,9 @@
104104
"fix": "npm run lint -- --fix",
105105
"beautify-lint": "beautify-lint \"lib/**/*.js\" \"hot/**/*.js\" \"bin/**/*.js\" \"benchmark/*.js\" \"test/*.js\"",
106106
"nsp": "nsp check --output summary",
107-
"benchmark": "mocha --max-old-space-size=4096 --harmony test/*.benchmark.js -R spec",
108-
"cover": "node --max-old-space-size=4096 --harmony ./node_modules/istanbul/lib/cli.js cover -x '**/*.runtime.js' node_modules/mocha/bin/_mocha -- test/*.test.js",
109-
"cover:min": "node --max-old-space-size=4096 --harmony ./node_modules/istanbul/lib/cli.js cover -x '**/*.runtime.js' --report lcovonly node_modules/mocha/bin/_mocha -- test/*.test.js",
107+
"benchmark": "mocha --max-old-space-size=4096 --harmony --trace-deprecation test/*.benchmark.js -R spec",
108+
"cover": "node --max-old-space-size=4096 --harmony --trace-deprecation ./node_modules/istanbul/lib/cli.js cover -x '**/*.runtime.js' node_modules/mocha/bin/_mocha -- test/*.test.js",
109+
"cover:min": "node --max-old-space-size=4096 --harmony --trace-deprecation ./node_modules/istanbul/lib/cli.js cover -x '**/*.runtime.js' --report lcovonly node_modules/mocha/bin/_mocha -- test/*.test.js",
110110
"publish-patch": "npm run lint && npm run beautify-lint && mocha && npm version patch && git push && git push --tags && npm publish"
111111
}
112112
}

0 commit comments

Comments
 (0)