Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 88dd568

Browse files
davinkevincnishina
authored andcommitted
fix(NoSuchElementError): add 'new' keyword to instantiate class
The class NoSuchElementError is called without the new keyword in the `ElementArrayFinder.prototype.count` causing a `Class constructors cannot be invoked without 'new'` closes #3079
1 parent 582411b commit 88dd568

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/element.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ ElementArrayFinder.prototype.count = function() {
340340
return this.getWebElements().then(function(arr) {
341341
return arr.length;
342342
}, function(err) {
343-
if (err.code == webdriver.error.NoSuchElementError()) {
343+
if (err.code == new webdriver.error.NoSuchElementError()) {
344344
return 0;
345345
} else {
346346
throw err;

0 commit comments

Comments
 (0)