fix(page): page.waitForFunction should work with multiline strings (#3727)

Fixes #3723
This commit is contained in:
Ram Dobson 2019-01-10 21:18:28 -05:00 committed by Andrey Lushnikov
parent 89fc2adff5
commit f73197385a

View File

@ -977,7 +977,7 @@ class WaitTask {
this._frame = frame; this._frame = frame;
this._polling = polling; this._polling = polling;
this._timeout = timeout; this._timeout = timeout;
this._predicateBody = helper.isString(predicateBody) ? 'return ' + predicateBody : 'return (' + predicateBody + ')(...args)'; this._predicateBody = helper.isString(predicateBody) ? 'return (' + predicateBody + ')' : 'return (' + predicateBody + ')(...args)';
this._args = args; this._args = args;
this._runCount = 0; this._runCount = 0;
frame._waitTasks.add(this); frame._waitTasks.add(this);