browserify / static-module

convert module usage to inline expressions
MIT License
74 stars 23 forks source link

Incorrect variable scopes #12

Closed devongovett closed 6 years ago

devongovett commented 9 years ago

Looks like static-module is just looking at the variable name globally, rather than in the correct scopes.

This code:

var a = require('fs');
function test(a) {
  return a;
}

emits this error:

Error: unsupported type for static module: FunctionDeclaration
at expression:

function test(a) {
    return a;
}

I took a stab at fixing this, but it looked like it may require a fairly large refactor.