Closed Bug 567361 Opened 14 years ago Closed 9 years ago

Get rid of the remaining engine-internal uses of JSContext::globalObject

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 981218

People

(Reporter: jorendorff, Unassigned)

Details

Is explicit is better than implicit here? I think so. I'm not going to tackle this, but I hope it'll inspire someone else. The uses are: - js_GetClassPrototype, when the scope argument is null and the JS stack is empty. (Note that there's a bug here where OOM from js_GetScopeChain is ignored.) This is the big one. Most of the 50 places that call js::NewObject would have to be changed to call something like, js::NewObjectWithScope, passing a scope parameter, such as JSVAL_TO_OBJECT(argv[-2]). - js_FindClassObject - similar deal but not called as much - JS_CloneFunctionObject, if parent is NULL and the JS stack is empty - js_ComputeGlobalThis, but I think that's going away in bug 556277 - js_InitEthogram (a bug, I think -- oops, my review) - There's an insidious comment in obj_create that mentions "the context's global object" in an insufficiently derogatory tone. FWIW that use of JS_GetScopeChain could probably be changed to JS_GetGlobalForScopeChain which stays on trace.
Assignee: general → nobody
This got renamed to "default compartment object", and removed in bug 981218, AFAICT.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.