On Mon, Oct 3, 2011 at 8:19 PM, Alan Jeffrey <span dir="ltr"><<a href="mailto:ajeffrey@bell-labs.com">ajeffrey@bell-labs.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I'm currently running through stImportedModules looking for a prefix, but that fails (er, currently crashing the --js compiler) in the case where a name is used without its defining module being imported.<br>
<br>
AFAICT, I'd have to run through all the prefixes, looking to find a prefix ms.n such that module m is a top-level module which defines n, which seems tricky, and possibly expensive. Oh, and I'm having to do this *every time* a name is emitted.</blockquote>
<div><br></div><div>Try looking at the stVisitedModules instead of the imported modules. You shouldn't have to worry about whether the module you find defines the thing, if it has the right name it does. Just looking through the names of all top-level modules for each name you have to emit shouldn't be a problem.</div>
<div><br></div><div>/ Ulf </div></div>