Index: test/elemHide.js |
=================================================================== |
--- a/test/elemHide.js |
+++ b/test/elemHide.js |
@@ -292,17 +292,19 @@ |
"html", "#foo", ".bar", "#foo .bar", "#foo > .bar", |
"#foo[data-bar='bar']" |
]), |
"html, #foo, .bar, #foo .bar, #foo > .bar, #foo[data-bar='bar'] " + |
"{display: none !important;}\n", |
"Style sheet creation should work" |
); |
- let selectors = new Array(50000).map((element, index) => ".s" + index); |
+ let selectors = new Array(50000); |
+ for (let index = 0; index < selectors.length; index++) |
+ selectors[index] = ".s" + index; |
hub
2019/02/12 23:55:49
The previous version of the code produced an Array
Manish Jethani
2019/02/13 12:27:25
I see, `Array.prototype.map` skips empty items.
T
|
test.equal((createStyleSheet(selectors).match(/\n/g) || []).length, |
Math.ceil(50000 / selectorGroupSize), |
"Style sheet should be split up into rules with at most " + |
selectorGroupSize + " selectors each"); |
test.done(); |
}; |