Skip to content

Commit

Permalink
Revert "Loosen WebElementCondition instance checks (#5968)"
Browse files Browse the repository at this point in the history
This reverts commit 5ec8094.

This commit was intended to fix a babel-related issue #5560.

Unfortunately it broke 'x instanceof WebElementCondition' check
that returns true even if 'x' is an instance of the 'Condition' class
(a base class for 'WebElementCondition'). All waits that return
a boolean value or a string are affected.
  • Loading branch information
barancev committed Jan 30, 2019
1 parent d176203 commit 6158311
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions javascript/node/selenium-webdriver/lib/webdriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,6 @@ class Condition {
description() {
return this.description_;
}

/**
* Allows for lenient instanceof checks
* @param {!(IThenable<T>|
* Condition<T>|
* function(!WebDriver): T)} condition - the condition instance
* @return {boolean}
*/
static [Symbol.hasInstance](condition) {
return !!condition
&& typeof condition === 'object'
&& typeof condition.description === 'function'
&& typeof condition.fn === 'function';
}
}


Expand Down

0 comments on commit 6158311

Please sign in to comment.