Open
Bug 1343946
Opened 9 years ago
Updated 3 years ago
XPCJSRuntime::InitializeStrings is a little weird
Categories
(Core :: XPConnect, enhancement, P3)
Core
XPConnect
Tracking
()
REOPENED
People
(Reporter: mccr8, Unassigned)
Details
This method, currently called XPCJSContext::JSContextInitialized, seems to have originally been called from multiple places, but is now only called once at XPConnect startup.
Here's the only call site:
if (!gSelf->mContext->JSContextInitialized(gSelf->mContext->Context()))
Notice that it passes in argument that is computed off the object itself! That's not needed.
The body of the method contains this check:
// if it is our first context then we need to generate our string ids
if (JSID_IS_VOID(mStrIDs[0])) {
However, we only ever call this once, so we should instead assert that mStrIDs[0] is void. (Also, the old-style macro here is probably not ideal.)
There's also this bit of code:
// these jsids filled in later when we have a JSContext to work with.
mStrIDs[0] = JSID_VOID;
Which seems a little weird. Maybe this InitializeStrings method could be called at the end of that method?
Also, it feels like setting mStrIDs could be set to VOID in the ctor. and also done for all of the fields and not just the first one.
Updated•9 years ago
|
Priority: -- → P3
Comment 1•8 years ago
|
||
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INACTIVE
Updated•8 years ago
|
Status: RESOLVED → REOPENED
Resolution: INACTIVE → ---
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•