From f73197385a5710ba1f78a548be2c6c8dd129dac3 Mon Sep 17 00:00:00 2001 From: Ram Dobson Date: Thu, 10 Jan 2019 21:18:28 -0500 Subject: [PATCH] fix(page): page.waitForFunction should work with multiline strings (#3727) Fixes #3723 --- lib/FrameManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/FrameManager.js b/lib/FrameManager.js index 031fc71d..26e5179f 100644 --- a/lib/FrameManager.js +++ b/lib/FrameManager.js @@ -977,7 +977,7 @@ class WaitTask { this._frame = frame; this._polling = polling; 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._runCount = 0; frame._waitTasks.add(this);