assert-throws-custom.js (375B)
1 // Copyright (C) 2015 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 description: > 6 Functions that throw instances of the specified constructor function 7 satisfy the assertion. 8 ---*/ 9 10 function MyError() {} 11 12 assert.throws(MyError, function() { 13 throw new MyError(); 14 }); 15 16 reportCompare(0, 0);