Closed
Bug 1155342
Opened 9 years ago
Closed 9 years ago
Disallow flagging [NewObject] methods with [Pure] or [Constant] or the corresponding [DependsOn] values
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla41
People
(Reporter: bzbarsky, Assigned: jj, Mentored)
References
(Blocks 1 open bug)
Details
(Whiteboard: [good first bug][lang=python])
Attachments
(1 file, 4 obsolete files)
1.81 KB,
patch
|
Details | Diff | Splinter Review |
Clearly something that's [NewObject] is not idempotent, so we shouldn't allow marking it [Pure]. It _could_ be marked as [DependsOn=DeviceState, Affects=Nothing], though, if it's side-effect-free. But [DependsOn=Nothing] and [DependsOn=DOMState] would be obvious lies. We should enforce this in IDLInterfaceMember.validate.
Reporter | ||
Updated•9 years ago
|
Mentor: bzbarsky
Reporter | ||
Updated•9 years ago
|
Whiteboard: [good first bug][lang=python]
Assignee | ||
Comment 1•9 years ago
|
||
Hi I would like to work on this bug could you help me out how to start off with this ?
Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(bzbarsky)
Reporter | ||
Comment 2•9 years ago
|
||
Have you already compiled Firefox? If not, start with that. If you have, then you want to be looking in dom/bindings/parser/WebIDL.py in the "validate" method of the IDLInterfaceMember class. There are existing checks there for the self.dependsOn value. You'd want to add another one: that if self.getExtendedAttribute("NewObject") then self.dependsOn is not "Nothing" and is not "DOMState". Also probably a good idea to assert that self.dependsOn is in DependsOnValues. Let me know if that's not enough to go on?
Flags: needinfo?(bzbarsky)
Assignee | ||
Comment 3•9 years ago
|
||
if self.getExtendedAttribute("NewObject"): if self.dependsOn != "Nothing" and self.dependsOn != "DOMState": raise WebIDLError("self.dependsOn is in DependsOnValues", [self.location]) I got and error while building it.
Reporter | ||
Comment 4•9 years ago
|
||
You got the check backwards, no? You're raising an error precisely in the case when you shouldn't.
Assignee | ||
Comment 5•9 years ago
|
||
Then what should I do precisely ?
Reporter | ||
Comment 6•9 years ago
|
||
You should raise an error if self.getExtendedAttribute("NewObject") and the dependsOn value is "Nothing" or "DOMState".
Assignee | ||
Comment 7•9 years ago
|
||
Reporter | ||
Comment 8•9 years ago
|
||
OK, so now that's the right conditions. The assertion about the self.dependsOn value being in DependsOnValues is missing, and the error message text is wrong. It should be more like "A [NewObject] method is not idempotent, so it has to depend on something other than DOM state."
Assignee | ||
Comment 9•9 years ago
|
||
Assignee | ||
Updated•9 years ago
|
Attachment #8613084 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 10•9 years ago
|
||
Should I now go for a try push ?
Reporter | ||
Comment 11•9 years ago
|
||
Comment on attachment 8613084 [details] [diff] [review] p1v2.diff r=me. Try push is good, yes. Can you do that yourself, or should I do it? Doing a build-only push on all platforms is enough here.
Attachment #8613084 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 12•9 years ago
|
||
Ya I could do it on my own but could you tell me what would be try message syntax
Assignee | ||
Comment 13•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=91f595cde124
Assignee | ||
Comment 14•9 years ago
|
||
Any Updates ?
Reporter | ||
Comment 15•9 years ago
|
||
Did your try run pass? If it did, you should add the "checkin-needed" keyword to this bug.
Assignee | ||
Comment 16•9 years ago
|
||
There are some problem with windows could you please check those things I have posted the the treehereder link
Reporter | ||
Comment 17•9 years ago
|
||
Looks like your push was on top of a changeset that doesn't actually build on Windows. I recommend picking a known-working changeset to do a try push on top of....
Reporter | ||
Updated•9 years ago
|
Flags: needinfo?(jinank94)
Assignee | ||
Comment 18•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=ffa28afb8c61
Flags: needinfo?(jinank94)
Assignee | ||
Comment 19•9 years ago
|
||
Still there are some bug with android build could you help me with that :)
Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(bzbarsky)
Reporter | ||
Comment 20•9 years ago
|
||
That looks like infrastructure issues that have nothing to do with your patch. This should be good to check in, but you need an actual commit message and user information in that diff, right?
Assignee: nobody → jinank94
Flags: needinfo?(bzbarsky) → needinfo?(jinank94)
Assignee | ||
Comment 21•9 years ago
|
||
Attachment #8613062 -
Attachment is obsolete: true
Attachment #8613084 -
Attachment is obsolete: true
Flags: needinfo?(jinank94)
Reporter | ||
Comment 22•9 years ago
|
||
Still needs a commit message. The commit message will typically look something like: Bug NNNNN. The stuff I changed. r=reviewer so in this case Bug 1155342. Disallow flagging a [NewObject] method with a [DependsOn] value that implies it might return the same value when called twice. r=bzbarsky or so.
Assignee | ||
Comment 23•9 years ago
|
||
Attachment #8620508 -
Attachment is obsolete: true
Reporter | ||
Comment 24•9 years ago
|
||
But without the try syntax in the commit message, yes? ;)
Assignee | ||
Comment 25•9 years ago
|
||
Attachment #8620525 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(bzbarsky)
Reporter | ||
Comment 26•9 years ago
|
||
Much better, yes.
Flags: needinfo?(bzbarsky)
Keywords: checkin-needed
Comment 27•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/7f6477aa2270
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/7f6477aa2270
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox41:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Reporter | ||
Comment 29•9 years ago
|
||
Jinank Jain, thank you for fixing this!
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•