Open
Description
I think an example is the easiest way to explain this.
var staticModule = require('static-module');
var rs = require('stream').Readable();
rs.push("var foo = require('foo');\n");
rs.push("window.x = foo(1, foo(2, 3, 4), foo(5, 6, 7));\n");
rs.push(null);
var sm = staticModule({
foo: function (x, y, z) {
return 'bar(' + x + ', ' + y + ', ' + z + ')'
}
});
rs.pipe(sm).pipe(process.stdout);
// expected: bar(1, bar(2, 3, 4), bar(5, 6, 7));
// actual: bar(1, bar(2, 3, 4), bar(5, 6, 7))bar(2, 3, 4)bar(5, 6, 7);