Skip to content

Commit 21cc4d9

Browse files
committed
[js] Minor cleanup
1 parent 58d0b7e commit 21cc4d9

File tree

1 file changed

+3
-6
lines changed
  • javascript/node/selenium-webdriver/lib

1 file changed

+3
-6
lines changed

javascript/node/selenium-webdriver/lib/http.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const error = require('./error');
3030
const logging = require('./logging');
3131
const promise = require('./promise');
3232
const Session = require('./session').Session;
33-
33+
const WebElement = require('./webdriver').WebElement;
3434

3535

3636
/**
@@ -409,13 +409,10 @@ function buildPath(path, parameters) {
409409
let key = pathParameters[i].substring(2); // Trim the /:
410410
if (key in parameters) {
411411
let value = parameters[key];
412-
// TODO: move webdriver.WebElement.ELEMENT definition to a
413-
// common file so we can reference it here without pulling in all of
414-
// webdriver.WebElement's dependencies.
415-
if (value && value['ELEMENT']) {
412+
if (WebElement.isId(value)) {
416413
// When inserting a WebElement into the URL, only use its ID value,
417414
// not the full JSON.
418-
value = value['ELEMENT'];
415+
value = WebElement.extractId(value);
419416
}
420417
path = path.replace(pathParameters[i], '/' + value);
421418
delete parameters[key];

0 commit comments

Comments
 (0)