shapesecurity / shift-scope-js

scope analyser for the Shift AST
http://shift-ast.org/scope.html
Apache License 2.0
11 stars 6 forks source link

properly mark parameter expressions for computed property bindings #66

Closed bakkot closed 4 years ago

bakkot commented 4 years ago

When a parameter of a function involves an arbitrary expression, it gets is own scope. We were properly observing that when the expression was a default value for a binding, but you can have an expression even without defaults:

function f({ [a]: b }) {}

This PR marks computed properties in object bindings as being expressions.