From 7e285711ca7d72a45bcec19039796354a9abbc6c Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 25 Apr 2017 13:16:07 -0700 Subject: [PATCH] Add spec for window.open toString errors --- spec/chromium-spec.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/chromium-spec.js b/spec/chromium-spec.js index 9cce9fe..dd992dc 100644 --- a/spec/chromium-spec.js +++ b/spec/chromium-spec.js @@ -361,6 +361,16 @@ describe('chromium feature', function () { }) b = window.open() }) + + it('throws an exception when the arguments cannot be converted to strings', function () { + assert.throws(function () { + window.open('', {toString: null}) + }, /Cannot convert object to primitive value/) + + assert.throws(function () { + window.open('', '', {toString: 3}) + }, /Cannot convert object to primitive value/) + }) }) describe('window.opener', function () { -- 2.7.4