Closed
Bug 1158522
Opened 9 years ago
Closed 9 years ago
JavaScript strict warning: .../mailCommands.js, line 77: SyntaxError: test for equality (==) mistyped as assignment (=)?
Categories
(SeaMonkey :: General, defect)
Tracking
(seamonkey2.41 fixed)
RESOLVED
FIXED
seamonkey2.41
Tracking | Status | |
---|---|---|
seamonkey2.41 | --- | fixed |
People
(Reporter: mmokrejs, Assigned: c0mrad3, Mentored)
Details
(Keywords: polish, Whiteboard: [good first bug][lang=js])
Attachments
(1 file, 2 obsolete files)
1.38 KB,
patch
|
neil
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33.1 Build ID: 20150425185639 Actual results: ++DOCSHELL 0x7fe755503a00 == 4 [pid = 2313] [id = 4] ++DOMWINDOW == 7 (0x7fe75953e080) [pid = 2313] [serial = 7] [outer = (nil)] JavaScript strict warning: chrome://messenger/content/mailCommands.js, line 77: SyntaxError: test for equality (==) mistyped as assignment (=)? JavaScript strict warning: chrome://messenger/content/mailWindowOverlay.js, line 1155: SyntaxError: octal literals and octal escape sequences are deprecated JavaScript strict warning: resource:///modules/FeedUtils.jsm, line 282: SyntaxError: applying the 'delete' operator to an unqualified name is deprecated JavaScript strict warning: resource:///modules/FeedUtils.jsm, line 283: SyntaxError: applying the 'delete' operator to an unqualified name is deprecated JavaScript strict warning: resource:///modules/FeedUtils.jsm, line 308: SyntaxError: applying the 'delete' operator to an unqualified name is deprecated JavaScript strict warning: resource:///modules/FeedUtils.jsm, line 309: SyntaxError: applying the 'delete' operator to an unqualified name is deprecated JavaScript strict warning: resource:///modules/FeedUtils.jsm, line 465: SyntaxError: applying the 'delete' operator to an unqualified name is deprecated JavaScript strict warning: resource:///modules/FeedUtils.jsm, line 1464: SyntaxError: applying the 'delete' operator to an unqualified name is deprecated JavaScript strict warning: chrome://messenger-newsblog/content/Feed.js, line 412: SyntaxError: applying the 'delete' operator to an unqualified name is deprecated JavaScript strict warning: chrome://communicator/content/tasksOverlay.js, line 91: SyntaxError: in strict mode code, functions may be declared only at top level or immediately within another function ++DOCSHELL 0x7fe7548e8400 == 5 [pid = 2313] [id = 5]
Updated•9 years ago
|
Mentor: neil, philip.chee
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: polish
Summary: JavaScript strict warning: chrome://messenger/content/mailCommands.js, line 77: SyntaxError: test for equality (==) mistyped as assignment (=)? → Do not use '=' inside 'if()' condition in mailCommands.js, line 77 as it triggers JS strict warnings: SyntaxError: test for equality (==) mistyped as assignment (=)?
Whiteboard: [good first bug][lang=js]
Comment 1•9 years ago
|
||
To silence the warning change: while (header = currentHeaderData[key]) { to: while ((header = currentHeaderData[key])) {
Summary: Do not use '=' inside 'if()' condition in mailCommands.js, line 77 as it triggers JS strict warnings: SyntaxError: test for equality (==) mistyped as assignment (=)? → JavaScript strict warning: .../mailCommands.js, line 77: SyntaxError: test for equality (==) mistyped as assignment (=)?
Assignee | ||
Comment 2•9 years ago
|
||
(In reply to Philip Chee from comment #1) > To silence the warning change: > while (header = currentHeaderData[key]) { > to: > while ((header = currentHeaderData[key])) { You too mistyped = instead of '==' I guess I would like to work on it can you assign this bug to me
Flags: needinfo?(neil)
Comment 3•9 years ago
|
||
(In reply to Tummala Dhanvi from comment #2) > You too mistyped = instead of '==' I guess No, the point is to assign to the variable. Adding the parentheses doesn't really make that clearer either; probably the simplest solution is just to remove that variable and repeat the use of currentHeaderData[key].
Flags: needinfo?(neil)
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8647563 -
Flags: review?
Assignee | ||
Comment 5•9 years ago
|
||
Philip can you review this patch for me ?
Flags: needinfo?(philip.chee)
Comment 6•9 years ago
|
||
Comment on attachment 8647563 [details] [diff] [review] Bug-1158522.patch Thanks for the patch! But in Comment 3 Neil wrote: > No, the point is to assign to the variable. Adding the parentheses doesn't > really make that clearer either; probably the simplest solution is just to > remove that variable and repeat the use of currentHeaderData[key]. I suggest something like: while (currentHeaderData[key]) { deliveredTos.push(currentHeaderData[key].headerValue.toLowerCase().trim()); key = "delivered-to" + index++; }
Flags: needinfo?(philip.chee)
Attachment #8647563 -
Flags: review? → feedback+
Assignee | ||
Comment 7•9 years ago
|
||
I will do it
Assignee | ||
Comment 8•9 years ago
|
||
(In reply to neil@parkwaycc.co.uk from comment #3) > (In reply to Tummala Dhanvi from comment #2) > > You too mistyped = instead of '==' I guess > > No, the point is to assign to the variable. Adding the parentheses doesn't > really make that clearer either; probably the simplest solution is just to > remove that variable and repeat the use of currentHeaderData[key]. but what if the currentHeaderData[key] becomes zero ? (I haven't dived into the source so it might be a silly doubt)
Flags: needinfo?(neil)
Comment 9•9 years ago
|
||
(In reply to Tummala Dhanvi from comment #8) > but what if the currentHeaderData[key] becomes zero ? The header data won't change as you enumerate it, if that's what you're asking.
Flags: needinfo?(neil)
Assignee | ||
Comment 10•9 years ago
|
||
Done
Attachment #8647563 -
Attachment is obsolete: true
Flags: needinfo?(philip.chee)
Attachment #8670302 -
Flags: review+
Assignee | ||
Comment 11•9 years ago
|
||
(In reply to neil@parkwaycc.co.uk from comment #9) > (In reply to Tummala Dhanvi from comment #8) > > but what if the currentHeaderData[key] becomes zero ? > > The header data won't change as you enumerate it, if that's what you're > asking. ya that's what I was asking :) so if my patch looks good can you review it for me ?
Flags: needinfo?(neil)
Comment 12•9 years ago
|
||
Comment on attachment 8670302 [details] [diff] [review] bug-1158522-v2.patch > deliveredTos.push(header.headerValue.toLowerCase().trim()); This line needs to be changed too.
Flags: needinfo?(neil)
Attachment #8670302 -
Flags: review+ → review-
Assignee | ||
Comment 13•9 years ago
|
||
Done, I have missed such a silly one clearly written in the comments
Attachment #8670302 -
Attachment is obsolete: true
Flags: needinfo?(philip.chee) → needinfo?(neil)
Attachment #8670361 -
Flags: review+
Comment 14•9 years ago
|
||
Comment on attachment 8670361 [details] [diff] [review] bug-1158522-v3.patch You need to set review to ? to request review... let me fix it for you.
Flags: needinfo?(neil)
Attachment #8670361 -
Flags: review+
Updated•9 years ago
|
Attachment #8670361 -
Flags: review+
Assignee | ||
Comment 15•9 years ago
|
||
(In reply to neil@parkwaycc.co.uk from comment #14) > Comment on attachment 8670361 [details] [diff] [review] > bug-1158522-v3.patch > > You need to set review to ? to request review... let me fix it for you. I didn't know it I thought that I need to keep + for requesting review, I won't repeat this mistake again
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 16•9 years ago
|
||
Pushed to comm-central: http://hg.mozilla.org/comm-central/rev/dff28c2b43af
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-seamonkey2.41:
--- → fixed
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.41
You need to log in
before you can comment on or make changes to this bug.
Description
•