Validator does not flag errors in for loop bodies.

RESOLVED FIXED in 5.12.12

Status

addons.mozilla.org Graveyard
Admin/Editor Tools
--
major
RESOLVED FIXED
7 years ago
2 years ago

People

(Reporter: kmag, Assigned: basta)

Tracking

unspecified
5.12.12

Details

Attachments

(1 attachment)

User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:2.0b12pre) Gecko/20110216 Firefox/4.0b12pre
Build Identifier: 

It seems that for loop bodies are entirely ignored by the JavaScript validator. While and do-while loops are unaffected. The attached XPI contains the following code fragments, and while the errors in the former set are flagged, those in the latter set are not:

eval("foo");
setTimeout("foo");
document.createElement("script");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPCOM");

for (var i=0; i < 1; i++) {
    eval("foo");
    setTimeout("foo");
    document.createElement("script");
    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPCOM");
}


Reproducible: Always
Created attachment 513700 [details]
Failing XPI
Assignee: nobody → mbasta
Target Milestone: --- → 5.12.12
(Assignee)

Comment 2

7 years ago
This might be because the interface for ForStatement nodes changed. Are you running your tests locally? If so, what build of Spidermonkey are you on?

I'll go ahead and check the docs.
(Assignee)

Comment 3

7 years ago
Yup, ForStatement has a "body" element. Updated.

https://github.com/mattbasta/amo-validator/commit/e5c5f798bfa17b17b73189eec43ef7dd39f6b03f
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.