Closed
Bug 365381
Opened 18 years ago
Closed 18 years ago
<method name="foo"><body/></method> doesn't compile
Categories
(Core :: XBL, defect)
Core
XBL
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: asaf, Assigned: Gavin)
Details
Attachments
(1 file, 1 obsolete file)
1.91 KB,
patch
|
Details | Diff | Splinter Review |
I've the following method defined in places' tree view (see http://lxr.mozilla.org/seamonkey/source/browser/components/places/content/tree.xml) <method name="destroyContextMenu"> <parameter name="aPopup"/> <body/> </method> We get a "destroyContextMenu is not a function" error when it is called unless <body/> is replaced with <body></body>. I see destroyContextMenu in DOMi's XBL view for the places tree, but not in its JavaScript object view for it.
Flags: blocking1.9?
Updated•18 years ago
|
Summary: <method name="foo><body/></method> doesn't complie → <method name="foo><body/></method> doesn't compile
Reporter | ||
Updated•18 years ago
|
Summary: <method name="foo><body/></method> doesn't compile → <method name="foo"><body/></method> doesn't compile
Assignee | ||
Updated•18 years ago
|
OS: Mac OS X 10.3 → All
Hardware: Macintosh → All
Assignee | ||
Comment 1•18 years ago
|
||
The reason <body></body> worked for Asaf is because he had whitespace between the two when he tested. "<body></body>" itself shows the same problem. Since nsXBLContentSink::FlushText is not called in those cases, we'd never call AppendBodyText on the nsXBLProtoImplMethod, so when it came time to compile the method in nsXBLProtoImplMethod::CompileMember we'd bail early and not create the function object. This makes us create function objects even if the body had no text content.
Assignee: general → gavin.sharp
Status: NEW → ASSIGNED
Attachment #250114 -
Flags: superreview?(bzbarsky)
Attachment #250114 -
Flags: review?(bzbarsky)
Comment 2•18 years ago
|
||
Comment on attachment 250114 [details] [diff] [review] patch >+ // Get the body >+ nsDependentString body; >+ PRUnichar *bodyText = mUncompiledMethod->mBodyText.GetText(); >+ if (bodyText) >+ body.Assign(bodyText); So the idea is that we want an empty body to be equivalent to "function () {}"? If so, this looks alright, except you want to use Rebind(), not Assign(). Assign() will copy the text, which we don't particularly want here. With that change, r+sr=bzbarsky
Attachment #250114 -
Flags: superreview?(bzbarsky)
Attachment #250114 -
Flags: superreview+
Attachment #250114 -
Flags: review?(bzbarsky)
Attachment #250114 -
Flags: review+
Assignee | ||
Comment 3•18 years ago
|
||
Attachment #250114 -
Attachment is obsolete: true
Assignee | ||
Comment 4•18 years ago
|
||
(In reply to comment #2) > So the idea is that we want an empty body to be equivalent to > "function () {}"? Yes. Thanks for the review!
Whiteboard: [checkin needed]
Assignee | ||
Comment 5•18 years ago
|
||
mozilla/content/xbl/src/nsXBLProtoImplMethod.cpp 1.34
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Target Milestone: --- → mozilla1.9beta
Assignee | ||
Updated•18 years ago
|
Target Milestone: mozilla1.9beta → mozilla1.9alpha
Updated•18 years ago
|
Flags: in-testsuite?
Updated•18 years ago
|
Flags: blocking1.9?
You need to log in
before you can comment on or make changes to this bug.
Description
•