nsIScriptContext *foo = ::JS_GetContextPrivate() callers should check for JSOPTION_PRIVATE_IS_NSISUPPORTS

RESOLVED FIXED in Future

Status

()

Core
DOM
RESOLVED FIXED
17 years ago
14 years ago

People

(Reporter: jst, Unassigned)

Tracking

Trunk
Future
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
Once the fix for bug 82845 is checked in, code that gets JSContext private data
and expects it to be of type nsIScriptContext should first check that the option
bit JSOPTION_PRIVATE_IS_NSISUPPORTS is set in the context, and then get the
nsISupports private data and QI to nsIScriptContext to be sure the private data
really is of type nsIScriptContext.
(Reporter)

Comment 1

16 years ago
Future.
Target Milestone: --- → Future
(Reporter)

Comment 2

15 years ago
Mass-reassigning bugs to dom_bugs@netscape.com
Assignee: jst → dom_bugs
jst, this is about callers of JS_GetContextPrivate?  If not, what function's
callers is this about?
I think this was mostly fixed by the fix for bug 209884. It seems like
http://lxr.mozilla.org/seamonkey/source/js/jsd/jsd_xpc.cpp#1445 could be fixed
and  http://lxr.mozilla.org/seamonkey/source/js/jsd/jsd_xpc.cpp#1539 could use
GetScriptContextFromJSContext. That's about it from a quick look at
http://lxr.mozilla.org/seamonkey/search?string=JS_GetContextPrivate
(Reporter)

Comment 5

14 years ago
jsd_xpc.cpp seems to do the right thing already, they check the context option
before the assume a context's private data is nsISupports, and it doesn't seem
to assume that it's nsIScriptContext anywhere (and I suspect it probably isn't,
so it can't use GetScriptContextFromJSContext()), so I say this bug is done,
fixed, all good.

Marking FIXED.
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.