fix: fallback to CSS (#9876)

This commit is contained in:
jrandolf 2023-03-17 13:23:14 +01:00 committed by GitHub
parent aa7c475461
commit e6ec9c2958
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,6 @@
import type {AwaitableIterable} from '../common/types.js'; import type {AwaitableIterable} from '../common/types.js';
import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js'; import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js';
import {isErrorLike} from '../util/ErrorLike.js';
import {ariaQuerySelectorAll} from './ARIAQuerySelector.js'; import {ariaQuerySelectorAll} from './ARIAQuerySelector.js';
import {customQuerySelectors} from './CustomQuerySelector.js'; import {customQuerySelectors} from './CustomQuerySelector.js';
@ -251,10 +250,7 @@ export const pQuerySelectorAll = function (
try { try {
[selectors, isPureCSS] = parsePSelectors(selector); [selectors, isPureCSS] = parsePSelectors(selector);
} catch (error) { } catch (error) {
if (!isErrorLike(error)) { return (root as unknown as QueryableNode).querySelectorAll(selector);
throw new SelectorError(selector, String(error));
}
throw new SelectorError(selector, error.message);
} }
if (isPureCSS) { if (isPureCSS) {