the one concern is that, all free names are stored into gcthings, even if it's not declared anywhere in the source, like, built-in objects (`Array`, `Date`, `Math`, etc), or window property (`document`, `window`, `console`, etc). at the point of syntax parsing inner function, we don't know if the name will be declared as `var` in the enclosing scope, after the function. so we cannot just filter out such case, with current way. we could defer the lazy script's gcthings calculation until the end of parse, and store only "declared-by-enclosing-scope names (that will become `NameLocation::EnvironmentCoordinate`) into lazy script gcthings, but that will require much more refactoring. maybe we should add special-handling for frequently-used free names.
Bug 1660275 Comment 19 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
the one concern is that, all free names are stored into gcthings, even if it's not declared anywhere in the source, like, built-in objects (`Array`, `Date`, `Math`, etc), or window property (`document`, `window`, `console`, etc). at the point of syntax parsing inner function, we don't know if the name will be declared as `var` in the enclosing scope after the function. so we cannot just filter out such case, with current way. we could defer the lazy script's gcthings calculation until the end of parse, and store only "declared-by-enclosing-scope names (that will become `NameLocation::EnvironmentCoordinate`) into lazy script gcthings, but that will require much more refactoring. maybe we should add special-handling for frequently-used free names.