w3c/testharness.js — pull request #14 by zcorpan (2013-03-18 16:09:55+00:00)
Title: Make step() return the argument's return value

One problem I ran into was that I wanted to use the return value of a step(), like so:

var rv = this.step(func);

Currently rv will be undefined.

This is convenient when having writing tests as follows:

check('description of test', function() { return new Blob(''); }, function(ev, input) { assert.... });

where the second argument is the "input", but needs to be run in a step because it might throw an exception, and I want to keep a reference to the return value so I can pass it in an argument to function(ev, input) { assert.... } instead of using a global variable.