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
I am currently in the process of adding Bazel support to our AngularJs based build, in preparation for an upgrade to Angular.
I ran into this problem during this.
Relevant Rules
Applies to ts_web_test_suite and karma rules.
Description
We have some older code that depends on exceptions being thrown when you try to modify an object that has had Object.freeze() applied to it.
It is important that we don't just get a silent error in those cases.
I understand that you cannot always simply keep the 'use strict'; annotation when concatenating files. It should however be okay when a function scope is applied around the code and the 'use strict'; annotation.
The default behaviour probably should be that it is removed at least for third party.
I ask for a supported solution to having strict mode enabled where needed.
I suggest that dependencies are treated different from local source and are allowed to work with strict mode, ideally you would be able to specify the behaviour per dependency as well.
Describe alternatives you've considered
Currently we are using a workaround by having two 'use strict'; at the top of the file. Only one of them is removed, I would however like to use a supported method.
I think we do this because of concatjs, but in May 2018 the 'use strict' was removed from google's copy of this code (googlers: cl/198411444)
So the right thing is to always turn on 'use strict' matching our google-internal. We should try to do it before 1.0 since it's a breaking change. Ideally we should open-source our karma config so that it stays in sync with what Google has in the future too.
🚀 feature request
I am currently in the process of adding Bazel support to our AngularJs based build, in preparation for an upgrade to Angular.
I ran into this problem during this.
Relevant Rules
Applies to
ts_web_test_suite
and karma rules.Description
We have some older code that depends on exceptions being thrown when you try to modify an object that has had
Object.freeze()
applied to it.It is important that we don't just get a silent error in those cases.
I understand that you cannot always simply keep the
'use strict';
annotation when concatenating files. It should however be okay when a function scope is applied around the code and the'use strict';
annotation.The default behaviour probably should be that it is removed at least for third party.
I ask for a supported solution to having strict mode enabled where needed.
The removal happens on line 49 in packages/karma/index.ts
Describe the solution you'd like
I suggest that dependencies are treated different from local source and are allowed to work with strict mode, ideally you would be able to specify the behaviour per dependency as well.
Describe alternatives you've considered
Currently we are using a workaround by having two
'use strict';
at the top of the file. Only one of them is removed, I would however like to use a supported method.The text was updated successfully, but these errors were encountered: