Skip to content

Commit 1abc6d8

Browse files
committed
chore: remove comment from within parsedFn
1 parent 34a19b2 commit 1abc6d8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/webpage.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,16 @@ export default class Webpage {
9595
getElementFromPage(pageFunction, selector, ...args) {
9696
const parsedFn = parseFunction(pageFunction, this.getBabelPresetOptions())
9797

98+
// It would be bettter to return undefined when no el exists,
99+
// but selenium always returns null for undefined so better to keep
100+
// the return value consistent
101+
98102
/* eslint-disable no-var */
99103
return this.runScript(
100104
/* istanbul ignore next */
101105
function (selector, fn, args) {
102106
var el = document.querySelector(selector)
103107
if (!el) {
104-
// undefined would be better but selenium returns null for undefined
105108
return null
106109
}
107110

0 commit comments

Comments
 (0)