Skip to content

Commit

Permalink
fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
dotneet committed Nov 24, 2017
1 parent 0ea402d commit 5103d4b
Show file tree
Hide file tree
Showing 2 changed files with 165 additions and 26 deletions.
176 changes: 158 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions src/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const {
* @param {CDP} [client] CDP instance
* @param {number} [nodeId=null]
*/

class Document {
constructor (chromy, client, nodeId = null) {
/**
Expand Down Expand Up @@ -168,18 +167,18 @@ class Document {
*
* @return {Promise} Returned value of `expr` function
*/

async evaluate (expr, options = {}) {
if ((expr instanceof Function) && (options instanceof Array)) {
options = options.map(function (parameter) {
return JSON.stringify(JSON.stringify(parameter));
});
return JSON.stringify(JSON.stringify(parameter))
})
// eslint-disable-next-line no-new-func
expr = new Function(`
return (${expr}).apply(this, Array.from(arguments).concat([${options}].map(function (parameter) {
return JSON.parse(parameter);
})));
`);
options = {};
return JSON.parse(parameter)
})))
`)
options = {}
}
return await this._evaluateWithReplaces(expr, options)
}
Expand Down

0 comments on commit 5103d4b

Please sign in to comment.