From f4f21896d2c573a2e16cd813804bc7aaa3f36b51 Mon Sep 17 00:00:00 2001 From: ylb Date: Fri, 2 Aug 2019 08:09:39 +0800 Subject: [PATCH] fix(page): fix page.screenshot method (#4786) This patch fixes page.screenshot. so that it throws correct error message when options.clip.height===0 --- lib/Page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Page.js b/lib/Page.js index 0a8acb5f858..dac0797f03f 100644 --- a/lib/Page.js +++ b/lib/Page.js @@ -879,7 +879,7 @@ class Page extends EventEmitter { assert(typeof options.clip.width === 'number', 'Expected options.clip.width to be a number but found ' + (typeof options.clip.width)); assert(typeof options.clip.height === 'number', 'Expected options.clip.height to be a number but found ' + (typeof options.clip.height)); assert(options.clip.width !== 0, 'Expected options.clip.width not to be 0.'); - assert(options.clip.height !== 0, 'Expected options.clip.width not to be 0.'); + assert(options.clip.height !== 0, 'Expected options.clip.height not to be 0.'); } return this._screenshotTaskQueue.postTask(this._screenshotTask.bind(this, screenshotType, options)); }