fix: apply sort directly in injected code
Signed-off-by: Valentin Brajon <vbrajon@gmail.com>
This commit is contained in:
parent
255143e201
commit
bd3eb0e1e0
|
|
@ -74,10 +74,8 @@ export class SelectorEvaluatorImpl implements SelectorEvaluator {
|
||||||
this._engines.set('near', createLayoutEngine('near'));
|
this._engines.set('near', createLayoutEngine('near'));
|
||||||
this._engines.set('nth-match', nthMatchEngine);
|
this._engines.set('nth-match', nthMatchEngine);
|
||||||
|
|
||||||
const allNames = [...this._engines.keys()];
|
const allNames = [...this._engines.keys()].sort();
|
||||||
allNames.sort();
|
const parserNames = [...customCSSNames].sort();
|
||||||
const parserNames = [...customCSSNames];
|
|
||||||
parserNames.sort();
|
|
||||||
if (allNames.join('|') !== parserNames.join('|'))
|
if (allNames.join('|') !== parserNames.join('|'))
|
||||||
throw new Error(`Please keep customCSSNames in sync with evaluator engines: ${allNames.join('|')} vs ${parserNames.join('|')}`);
|
throw new Error(`Please keep customCSSNames in sync with evaluator engines: ${allNames.join('|')} vs ${parserNames.join('|')}`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue