Closed
Bug 1395421
Opened 7 years ago
Closed 7 years ago
Add a notification when get() is called on a JS-implemented maplike
Categories
(Core :: DOM: Core & HTML, enhancement)
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(2 files)
2.76 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
8.67 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
This is needed in bug 1393306.
Assignee | ||
Comment 1•7 years ago
|
||
MozReview-Commit-ID: 6voihCBh6wh
Attachment #8902992 -
Flags: review?(peterv)
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•7 years ago
|
||
MozReview-Commit-ID: 9G115wOyzvm
Attachment #8902993 -
Flags: review?(peterv)
Assignee | ||
Comment 3•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=aa1043943b85e4edd873450a33cf74f158d34619
Comment 4•7 years ago
|
||
Comment on attachment 8902992 [details] [diff] [review] part 1. Don't codegen JS-implemented-webidl glue for methods that use maplike/setlike/iterable codegen (and hence wouldn't call into that clue anyway) Review of attachment 8902992 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bindings/Codegen.py @@ +15919,5 @@ > for a in attrs if not a.readonly] > methods = [m for m in iface.members > + if (m.isMethod() and not m.isStatic() and > + not m.isIdentifierLess() and > + not m.isMaplikeOrSetlikeOrIterableMethod())] So I think maplike is allowed on callback interfaces according to spec. Not sure that makes sense, but if so should we limit this to iface.isJSImplemented()?
Attachment #8902992 -
Flags: review?(peterv) → review+
Comment 5•7 years ago
|
||
Comment on attachment 8902993 [details] [diff] [review] part 2. When a get() happens on a JS-implemented maplike, notify the JS implementation so it can take some sort of action (e.g. logging or warning) Review of attachment 8902993 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bindings/Codegen.py @@ +15953,1 @@ > if any(m.isAttr() or m.isMethod() for m in iface.members) or (iface.isJSImplemented() and iface.ctor()): This might not be true even though needOnGetId is? Might make more sense to just fill idList with the additional ids instead of using these booleans and then append initIdsClassMethod if idList is not empty? @@ +16483,5 @@ > + happening on a JS-implemented maplike. This method takes two arguments > + (key and value) and returns nothing. > + """ > + def __init__(self, descriptor): > + CallbackOperationBase.__init__( I sort of expected this to be optional, but it'll throw if __onget is missing, right? I guess we'd need to change GetCallableProperty to make that not throw. Not sure it's worth it.
Attachment #8902993 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 6•7 years ago
|
||
> but if so should we limit this to iface.isJSImplemented()? Yeah, probably we should. Done. > This might not be true even though needOnGetId is? Oh, good catch. I should have used my two new booleans, but I like your suggestion more. Will do that. > I sort of expected this to be optional, but it'll throw if __onget is missing, right? Yes. In practice, we have precisely one non-test JS-implemented maplike and that one is the one that wants __onget, so this is OK, I think. > I guess we'd need to change GetCallableProperty to make that not throw. Not sure it's worth it. Exactly my reasoning. ;)
Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/196ede21eb28 part 1. Don't codegen JS-implemented-webidl glue for methods that use maplike/setlike/iterable codegen (and hence wouldn't call into that clue anyway). r=peterv https://hg.mozilla.org/integration/mozilla-inbound/rev/dad6d3dd7404 part 2. When a get() happens on a JS-implemented maplike, notify the JS implementation so it can take some sort of action (e.g. logging or warning). r=peterv
Comment 8•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/196ede21eb28 https://hg.mozilla.org/mozilla-central/rev/dad6d3dd7404
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
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
•