browserify / browserify/static-module

Nested static module replacements don't work

Open
#16 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
75
Forks
22
PR merge metrics
No merged PRs in 30d

Description

I think an example is the easiest way to explain this.

``` js
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);
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.