Closed
Bug 632064
Opened 14 years ago
Closed 13 years ago
remove/deprecate JS_GetScopeChain in lieu of JS_GetGlobalForScopeChain
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla10
People
(Reporter: luke, Assigned: luke)
References
Details
(Keywords: dev-doc-complete)
Attachments
(2 files)
21.53 KB,
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
2.43 KB,
patch
|
igor
:
review+
|
Details | Diff | Splinter Review |
mxr shoes that 100% of the uses of JS_GetScopeChain in Mozilla are to get at the scope chain's global. (Is there any other valid thing to do with it? Hopefully not implement some form of dynamic name lookup.) Since JS_GetGlobalForScopeChain is what everybody wants (and its more efficient in more than one way), can we nix JS_GetScopeChain or deprecate it and just have it return JS_GetGlobalForScopeChain? My motivation is that the less leaky API will give us more flexibility (bug 631135 is a weak example) and, when we get around to the scope chain overhaul (bug ?), scope chains won't be objects (while global objects clearly will).
Simple patch. Will ask on the listserv if no immediate objections.
Assignee | ||
Comment 1•14 years ago
|
||
(In reply to comment #0)
> (bug 631135 is a weak example)
Hah, 1 hour later it becomes a strong example (end of bug 631135 comment 23).
Assignee | ||
Comment 2•14 years ago
|
||
Waldo's on it!
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Comment 3•14 years ago
|
||
Luke: bug 511781 is not the bug you have in mind.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Assignee | ||
Comment 4•14 years ago
|
||
D'oh!
Status: REOPENED → RESOLVED
Closed: 14 years ago → 14 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Comment 5•13 years ago
|
||
Bug 511781 never got fixed, but it will be fixed by compartment-per-global, so I'll fix this bug now.
Assignee: general → luke
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Assignee | ||
Comment 6•13 years ago
|
||
This patch also fixes some annoying && || warnings.
Attachment #563462 -
Flags: review?(mrbkap)
Assignee | ||
Comment 7•13 years ago
|
||
The assumption of this patch is that, whatever E4X wants to find on the scope chain, it causes a call-obj to be created and put on the scope chain, hence the lazy call-obj creation done by GetScopeChain is unnecessary. Is that correct Igor?
Attachment #564690 -
Flags: review?(igor)
Comment 8•13 years ago
|
||
Comment on attachment 564690 [details] [diff] [review]
rm xml uses of GetScopeChain
Review of attachment 564690 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jsxml.cpp
@@ +1762,5 @@
>
> {
> Parser parser(cx);
> if (parser.init(chars, length, filename, lineno, cx->findVersion())) {
> + JSObject *scopeChain = GetCurrentScopeChain(cx);
IIRC this scope chain can be replaced by the global. If so, then we can fold the GetCurrentScopeChain into js_GetDefaultXMLNamespace. But this can wait another bug.
Attachment #564690 -
Flags: review?(igor) → review+
Updated•13 years ago
|
Attachment #563462 -
Flags: review?(mrbkap) → review+
Assignee | ||
Comment 9•13 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/151f190c27ab
https://hg.mozilla.org/integration/mozilla-inbound/rev/d749864ebd01
Target Milestone: --- → mozilla10
Updated•13 years ago
|
Keywords: dev-doc-needed
Comment 10•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/151f190c27ab
https://hg.mozilla.org/mozilla-central/rev/d749864ebd01
Status: REOPENED → RESOLVED
Closed: 14 years ago → 13 years ago
Resolution: --- → FIXED
Comment 11•13 years ago
|
||
Short notice at https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_GetScopeChain, that suggests using JS_GetGlobalForScopeChain.
Added entry to 1.8.7 release notes.
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•