Please sign in to comment.
Fix: func-name-matching crash on non-string literal computed keys (#8246
) * Fix: func-name-matching crash on non-string literal computed keys In order to detect whether it should require a function name match, the `func-name-matching` rule checks to see if a computed object key is a string literal, and if so, it performs operations on the value of the string literal. However, the rule was previously only verifying that the computed object key was a literal, without verifying that it was a *string* literal. As a result, if other literals (e.g. `null`) were used as computed object keys, the rule would crash. This fix updates the rule to check that the object key is a *string* literal. * Add additional test cases for literals
- Loading branch information...
Showing with 39 additions and 2 deletions.