ariya/phantomjs — pull request #403 by jgonera (2013-02-03 07:23:56+00:00)
Title: Make require.stub() optionally accept a factory function

`require.stub()` can now accept a factory function instead of an object
so that stubbed modules are initialized lazily:

```js
require.stub('zlib', function() {
// initialized once, when zlib first required
return {
createGzip: function() { ... }
};
});
```

http://code.google.com/p/phantomjs/issues/detail?id=1044