-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Arrow functions not working in Chrome 50 with ngMock inject #14487
Comments
Which version of angular do you use? |
Sorry I should have wrote that. I used Angular 1.5 and then test it with I really don't know if its karma or angular or even jasmine, but everything The same thing happened to me, in my dev machine. While I was running on I didn't change karma, jasmine nor angular version. The only thing I end up On Thu, Apr 21, 2016 at 10:53 AM Martin Staffa notifications@github.com
|
I'm using Chrome 50.0.2661.75 m |
The thing is this: I use TS. For my app the output is ES5, but for my tests I was using ES6 output. And they were running ok until two days ago. Every project that had the tests output to ES6, for karma only, starting failing. After a couple of hours I realized that the Chrome version was different. When I updated my dev machine the same happened. I changed the output for karma tests to ES5, and everything starting working again. Maybe something changed in chrome core, and angular got broken. |
I can reproduce this. It must be because of the inject fn. But I don't know what changed in Chrome 50 that this doesn't work anymore. |
It looks like the output of toString for fat arrow functions has changed edit: but shouldn't that also affect regular usage? Weird. |
This seems to be indeed a bug in Chrome. The problem happens in here, where we try to extract the arguments from the arrow function. Although
|
Hi there, before the Chrome 50 update arrow functions were working for me, but suddenly karma started to failed. The message is something with the
Injector
.I dont know if arrow functions were intended to work or not, but they dont work anymore.
This used to work with Chrome 49.x:
I solved it using
function
:Here's the error message, its very easy to reproduce:
The text was updated successfully, but these errors were encountered: