3 ms·
The last example doesn't seem to work on node 0.10.17: if (sieve[(x / 8) >>> 0] & (1 << (x % 8))) { ^ TypeError: Cannot read property
by nonchalance 13y ago
The last example doesn't seem to work on node 0.10.17:
if (sieve[(x / 8) >>> 0] & (1 << (x % 8))) {
^
TypeError: Cannot read property '0' of undefined
- tonetheman 13y agothink it might be because fill may not return a value, prob just need to call sieve.fill on a separate line after you declare it.
- thedufer 13y agoNor in 0.8.23. I think the chaining of the constructor to .fill in `var sieve = new SB(len).fill(0xff, 0, len);` is the issue, because SlowBuffer::fill isn't supposed to have a return value.
- trevnorris 13y agoAh yeah. I forgot that Buffer#fill() only returns "this" in master. I updated the example to fix this.