Check JS_HAZ_CAN_RUN_SCRIPT annotations when deciding whether an IDL method can be implemented in JS
Categories
(Core :: JavaScript: GC, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox100 | --- | fixed |
People
(Reporter: sfink, Assigned: sfink)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Make use of the work in bug 1347999. I think it's valid to say now that only methods on an nsISupports subclass that are marked JS_HAZ_CAN_RUN_SCRIPT can indeed be implemented in JS.
Comment 1•3 years ago
|
||
While I think this should be generally sound, there's one tricky case here, which is when an interface is [scriptable] and not [builtinclass], but a method or attribute is marked [noscript]. An example of this is nsIInputStream::read.
In this case, the method can't be implemented in JS, so we don't mark it with JS_HAZ_CAN_RUN_SCRIPT.
Nika pointed me at the piece of code in nsXPCWrappedJS::CallMethod() that intercepts and rejects attempts to call into JS:
However, we do run AutoEntryScript before that check, so if that can GC, then it means we can still GC in this case. Of course, the easy fix is to move the IsReflectable check earlier before we do anything that can GC.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
Updated•3 years ago
|
Comment 3•3 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:sfink, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.
Comment 5•3 years ago
|
||
bugherder |
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Description
•