Skip to content

Commit

Permalink
[js] Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jleyba committed May 18, 2016
1 parent 58d0b7e commit 21cc4d9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions javascript/node/selenium-webdriver/lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const error = require('./error');
const logging = require('./logging');
const promise = require('./promise');
const Session = require('./session').Session;

const WebElement = require('./webdriver').WebElement;


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

0 comments on commit 21cc4d9

Please sign in to comment.