Add spec for window.open toString errors
authorKevin Sawicki <kevinsawicki@gmail.com>
Tue, 25 Apr 2017 20:16:07 +0000 (13:16 -0700)
committerKevin Sawicki <kevinsawicki@gmail.com>
Wed, 26 Apr 2017 16:08:47 +0000 (09:08 -0700)
spec/chromium-spec.js

index 9cce9fe..dd992dc 100644 (file)
@@ -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 () {