Monarch should always return non-null tokens

This commit is contained in:
Alex Dima 2017-01-01 16:14:06 +02:00
parent 7efe807786
commit 74b5f506cb

View file

@ -336,14 +336,14 @@ class MonarchModernTokensCollector implements IMonarchTokensCollector {
let bLen = b.length;
let cLen = (c !== null ? c.length : 0);
// Fast path
if (bLen === 0) {
if (aLen === 0) {
return c;
}
if (cLen === 0) {
return a;
}
if (aLen === 0 && bLen === 0 && cLen === 0) {
return new Uint32Array(0);
}
if (aLen === 0 && bLen === 0) {
return c;
}
if (bLen === 0 && cLen === 0) {
return a;
}
let result = new Uint32Array(aLen + bLen + cLen);