Add an example of using assert.throws

This commit is contained in:
Domenic Denicola 2014-12-03 18:31:38 -05:00
parent fa4c337570
commit 66a39c0423

View File

@ -6,9 +6,10 @@ info: >
Promise throws TypeError when 'this' is constructed but unsettled promise Promise throws TypeError when 'this' is constructed but unsettled promise
author: Sam Mikes author: Sam Mikes
description: Promise.call(new Promise()) throws TypeError description: Promise.call(new Promise()) throws TypeError
negative: TypeError
---*/ ---*/
var p = new Promise(function() {}); var p = new Promise(function() {});
Promise.call(p, function () {}); assert.throws(TypeError, function () {
Promise.call(p, function () {});
});