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
While looking into #4645, I noticed that the underlying issue is that one cannot make any assumptions on this.parsedJSON, other than it being JSON. There are multiple instances where this assumption is violated:
Test case, create manifest.json with the following content and run the linter on it:
{
"content_scripts": {
"length": true
}
}
Similarly,
{
"browser_action": {
"theme_icons": true
}
}
What happened?
TypeError: this.parsedJSON.content_scripts.forEach is not a function
TypeError: this.parsedJSON.browser_action.theme_icons.forEach is not a function
What did you expect to happen?
Validation errors for the manifest being invalid, including MANIFEST_FIELD_INVALID with message "/content_scripts" must be an array.
And for the second test case, "/browser_action/theme_icons" must be an array
Describe the problem and steps to reproduce it:
While looking into #4645, I noticed that the underlying issue is that one cannot make any assumptions on
this.parsedJSON
, other than it being JSON. There are multiple instances where this assumption is violated:addons-linter/src/parsers/manifestjson.js
Lines 533 to 537 in e1f8902
addons-linter/src/parsers/manifestjson.js
Lines 884 to 888 in e1f8902
Test case, create
manifest.json
with the following content and run the linter on it:Similarly,
What happened?
What did you expect to happen?
Validation errors for the manifest being invalid, including
MANIFEST_FIELD_INVALID
with message"/content_scripts" must be an array
.And for the second test case,
"/browser_action/theme_icons" must be an array
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: