It might be clearer to move the function out of the call:

function f(value) { doc.register(value); }
assert_throws(null, f, 'Exception ...');