0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00

assert.throws

This commit is contained in:
Eliot Horowitz 2009-02-18 13:54:08 -05:00
parent 94b7902390
commit e0762fd1ba

View File

@ -25,6 +25,18 @@ assert.soon = function( f ) {
}
}
assert.throws = function( func , params , msg ){
try {
func.apply( null , params );
}
catch ( e ){
return e;
}
throw "did not throw exception: " + msg ;
}
Object.extend = function( dst , src ){
for ( var k in src ){
dst[k] = src[k];