mirror of
https://github.com/encounter/phantomjs.git
synced 2026-03-30 11:35:11 -07:00
2d42b52c67
require.stub() can now accept a factory function instead of an object
so that stubbed modules are initialized lazily:
require.stub('zlib', function() {
// initialized once, when zlib first required
return {
createGzip: function() { ... }
};
});
http://code.google.com/p/phantomjs/issues/detail?id=1044