chore: assert selector is a string (#1795)

Fixes #1735
This commit is contained in:
Pavel Feldman 2020-04-14 23:16:37 -07:00 committed by GitHub
parent d07105aa0b
commit e9b470096d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,7 @@
import * as dom from './dom';
import * as frames from './frames';
import * as selectorEvaluatorSource from './generated/selectorEvaluatorSource';
import { helper } from './helper';
import { helper, assert } from './helper';
import SelectorEvaluator from './injected/selectorEvaluator';
import * as js from './javascript';
import * as types from './types';
@ -163,6 +163,7 @@ export class Selectors {
}
private _parseSelector(selector: string): types.ParsedSelector {
assert(helper.isString(selector), `selector must be a string`);
let index = 0;
let quote: string | undefined;
let start = 0;