Closed
Bug 232827
Opened 21 years ago
Closed 21 years ago
In <bookmarks.js>, "Error: aTarget has no properties" at line 856
Categories
(SeaMonkey :: Bookmarks & History, defect)
SeaMonkey
Bookmarks & History
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.7beta
People
(Reporter: durbacher, Assigned: p_ch)
Details
(Keywords: regression, Whiteboard: [Error text: see comment 3])
Attachments
(3 obsolete files)
User-Agent:
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113
This regressed between 20040113 and 20040115.
I strongly suspect the checkin for bug 228432 because it touched setting
bookmarksTree _target there, which is what fails to have a value.
The error originates in
http://lxr.mozilla.org/seamonkey/source/xpfe/components/bookmarks/resources/bookmarksTree.xml#645
and propagates through "BookmarksController.onCommandUpdate(selection, target);"
in the same file. "target" is null there.
Reproducible: Always
Steps to Reproduce:
1. open the bookmarks manager
or
1. drag a bookmark from the bookmarks manager to the personal toolbar
Reporter | ||
Comment 1•21 years ago
|
||
That checkin was by timeless, so cc'ing him.
I'm not sure of the results of this bug, but it would be nice if you could have
a look at it before 1.7a.
Reporter | ||
Updated•21 years ago
|
Keywords: regression
well erm, i just moved a warning. the case which triggered the warning should
presumably be the case which triggers this bug. i can't imagine my change
actually influenced the bug...
Reporter | ||
Comment 3•21 years ago
|
||
Ok, I see...
Well, I forgot to mention the actual error message:
> Error: aTarget has no properties
> Source File: chrome://communicator/content/bookmarks/bookmarks.js
> Line: 856
The source is in isCommandEnabled:
case "cmd_bm_newbookmark":
case "cmd_bm_newfolder":
case "cmd_bm_newseparator":
856 return BookmarksUtils.isValidTargetContainer(aTarget.parent);
Summary: JS error: aTarget has no properties in bookmarks.js → JS error: aTarget has no properties in bookmarks.js line 856
Comment 4•21 years ago
|
||
[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7a) Gecko/20040219] (W98SE)
I'm not sure of "my" testcase, but I already got this error twice...
Summary: JS error: aTarget has no properties in bookmarks.js line 856 → In <bookmarks.js>, "Error: aTarget has no properties" at line 856
Whiteboard: [Error text: see comment 3]
Comment 5•21 years ago
|
||
(In reply to comment #2)
> i can't imagine my change actually influenced the bug...
Well, it did :-<
Confirming that it's a "regression" from bug 228432 attachment 137392 [details] [diff] [review].
(In reply to comment #4)
> [Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7a) Gecko/20040219] (W98SE)
>
> I'm not sure of "my" testcase, but I already got this error twice...
Actually, I get it quite often:
opening B.M. (as noted in comment 0), and much more.
I noticed that this involved code is executed twice during the B.M. opening:
the error happens the second time only...
Comment 6•21 years ago
|
||
(In reply to comment #5)
>
> I noticed that this involved code is executed twice during the B.M. opening:
> the error happens the second time only...
My mistake:
It happens the FIRST time only, because |selection.length| equals |0| on this
first call...
Comment 7•21 years ago
|
||
(In reply to comment #5)
>
> I noticed that this involved code is executed twice during the B.M. opening:
Assuming that this is the intended behaviour;
I believe that timeless's patch revealed this bug, more than created it.
Comment 8•21 years ago
|
||
The 2 |aTarget &&| fix this bug: fixing L856 reveals L817 !
Plus:
*a few "used once" variable removals;
*1 unused |var target| removal;
*1 |return| was missing a |;|.
Updated•21 years ago
|
Attachment #142544 -
Flags: review?(neil.parkwaycc.co.uk)
Comment 9•21 years ago
|
||
Comment on attachment 142544 [details] [diff] [review]
(Av1) <bookmarks.js ++>
>@@ -973,10 +974,9 @@ var BookmarksController = {
> "cmd_bm_sortfolder", "cmd_bm_sortfolderbyname",
> "cmd_undo", "cmd_redo", "cmd_bm_undo", "cmd_bm_redo"];
> for (var i = 0; i < commands.length; ++i) {
>- var enabled = this.isCommandEnabled(commands[i], aSelection, aTarget);
> var commandNode = document.getElementById(commands[i]);
> if (commandNode) {
>- if (enabled)
>+ if (this.isCommandEnabled(commands[i], aSelection, aTarget))
> commandNode.removeAttribute("disabled");
> else
> commandNode.setAttribute("disabled", "true");
Bonus points to the person who checks this in for fixing the indent of
if (commandNode) {
to match the line above.
Attachment #142544 -
Flags: review?(neil.parkwaycc.co.uk) → review+
Updated•21 years ago
|
Attachment #142544 -
Attachment is obsolete: true
Comment 10•21 years ago
|
||
Av1, with comment 9 suggestion(s).
Comment 11•21 years ago
|
||
Av1, with comment 9 suggestion(s).
Updated•21 years ago
|
Attachment #143184 -
Attachment description: (Av2) <bookmarks.js ++> → (Av2) <bookmarks.js ++> (== att.143183)
Attachment #143184 -
Attachment is obsolete: true
Comment 12•21 years ago
|
||
Comment on attachment 143183 [details] [diff] [review]
(Av2) <bookmarks.js ++>
[Checked in: Comment 14]
Keeping { (Av1) <bookmarks.js ++> patch 2004-02-28 11:52 PST
neil.parkwaycc.co.uk: review+ }
Attachment #143183 -
Flags: superreview?(jag)
Attachment #143183 -
Flags: review+
Comment 13•21 years ago
|
||
Comment on attachment 143183 [details] [diff] [review]
(Av2) <bookmarks.js ++>
[Checked in: Comment 14]
sr=jag
Attachment #143183 -
Flags: superreview?(jag) → superreview+
Comment 14•21 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•21 years ago
|
Attachment #143183 -
Attachment description: (Av2) <bookmarks.js ++> → (Av2) <bookmarks.js ++>
[Checked in: Comment 14]
Attachment #143183 -
Attachment is obsolete: true
Updated•21 years ago
|
Target Milestone: --- → mozilla1.7beta
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•