Strange "empty-function-body into broken-array" mutation?
See original GitHub issueThis looks like it wants to mutate
angular.module('juiceShop').controller('AboutController', [
function () {}])
into
angular.module('juiceShop').controller('AboutController', [
function () { })
which doesn’t seem like a good idea, syntax-wise with that missing closing angular bracket… or maybe it’s just rendered wrong in the HTML report?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Washing your code: avoid mutation - Artem Sapegin
Mutations happen when we change a JavaScript object or array without creating a new variable or reassigning an existing one.
Read more >Having Trouble Understanding Empty Initializer in Reduce ...
The empty object is the initial value of the accumulator, which gets a property assigned to it on each iteration. The object does...
Read more >Discuss Remove the minimum - Codewars
I used python to solve the problem. I have not mutated the input array, but one testcase tells me that I have mutated...
Read more >Mutation, Repair and Recombination - Genomes - NCBI - NIH
Some mutations are spontaneous errors in replication that evade the proofreading function of the DNA polymerases that synthesize new polynucleotides at the ...
Read more >Arrays, Objects and Mutations - Medium
Here are some thoughts on how to avoid mutations when working with arrays and objects in JavaScript by treating them as if they...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I did remove the ‘use strict’ because I thought that triggered the mutation. But it still mutated the empty block.
I would just ignore empty blocks, if anything other than statements (even comments!) is in a block, it should mutate. This kind of brought the useless ‘use strict’ with no subsequent code to my attention.
Fine for me. Plese ping me when I should re-test this!