babel-plugin-angularjs-annotate icon indicating copy to clipboard operation
babel-plugin-angularjs-annotate copied to clipboard

Block unsafe use of arrow functions

Open schmod opened this issue 9 years ago • 2 comments

Arrow functions cannot be safely used in providers or services, because these types are intended to be invoked with the new operator, and expect to have their own value of this.

We should discourage (or outright disallow) people from doing this, because the breakages that it causes could lead to subtle and unpredictable bugs.

schmod avatar Jul 25 '16 18:07 schmod

Counterpoint: This could be beyond the scope of what this project is meant to provide.

schmod avatar Jul 25 '16 18:07 schmod

Yeah, I think such things are more in scope of a linter.

mgol avatar Jul 26 '16 11:07 mgol