You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 20, 2020. It is now read-only.
Hi I run into a problem in Chrome due to 'use strict' statement at the top of function in my code. It seems to be a bug (or feature) in Chrome. My code sample is shown below:
Funny enough issue is happening only when dev tools are closed. When you open them you can see something like:
If you'll refresh the page, it will work just fine and those errors will not show up anymore.
If I take 'use strict' away, coverage starts to work. Also my code works fine without coverage. So, I was experimenting with code and figured that it is enough to just add a semicolon (or anything valid) in front on 'use strict' statement to make code work - instrumented code now will look like:
So my suggestion is to add an option to transform code before instrumentation via instrumenterOptions. Something like a callback function would be perfect. What do you think? If you like idea I can create a PR.
The text was updated successfully, but these errors were encountered:
Hey @srn, it works. I'm not sure if I can do that to my code though. Once jsx code will be transformed to js, I'll end with global 'use strict', which could break some legacy code if I understand things correctly.
Hi I run into a problem in Chrome due to 'use strict' statement at the top of function in my code. It seems to be a bug (or feature) in Chrome. My code sample is shown below:
Instrumented code looks like:
Funny enough issue is happening only when dev tools are closed. When you open them you can see something like:
If you'll refresh the page, it will work just fine and those errors will not show up anymore.
If I take 'use strict' away, coverage starts to work. Also my code works fine without coverage. So, I was experimenting with code and figured that it is enough to just add a semicolon (or anything valid) in front on 'use strict' statement to make code work - instrumented code now will look like:
So my suggestion is to add an option to transform code before instrumentation via
instrumenterOptions
. Something like a callback function would be perfect. What do you think? If you like idea I can create a PR.The text was updated successfully, but these errors were encountered: