Closed Bug 1142241 Opened 7 years ago Closed 7 years ago

Stop using getParent() in js::GetObjectEnvironmentObjectForFunction

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

Really, the consumer cares only about the DynamicWithObject case here.  So it doesn't even matter too much what we return in the other cases, but let's just return the global.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Comment on attachment 8576243 [details] [diff] [review]
Stop using getParent() in js::GetObjectEnvironmentObjectForFunction

Review of attachment 8576243 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/vm/ScopeObject.cpp
@@ +2501,5 @@
>  }
>  
>  // See declaration and documentation in jsfriendapi.h
>  JS_FRIEND_API(JSObject *)
>  js::GetObjectEnvironmentObjectForFunction(JSFunction *fun)

This is a bizarre function with a bizarre user.  No wonder it's friendapi.
Attachment #8576243 - Flags: review?(jwalden+bmo) → review+
https://hg.mozilla.org/mozilla-central/rev/326e615308cc
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.