ForbesLindesay/constantinople — pull request #2 by jeromew (2014-06-13 14:45:57+00:00)
Title: Fix #1: An expression using `this` is not constant

Maybe you will find another way to fix this.
I did not find :
* an uglifyjs API that could answer the has(AST_This) question
* a way to stop the walking upon the first AST_This found

Throwing an exception could be an idea since it would return false but "goto as an exception" is rarely the best option ;-)

I hope you will agree with me that "this.myVar" is not constant ! this is done in order to allow

div(onClick=this.handleClick)

in `react-jade` so that we can have more real-life components (`this` scope in the `render` function is heavily used to reference the component instances (this.functions, this.props, this.state)