Closed Bug 1140399 Opened 9 years ago Closed 9 years ago

Add friend API to check whether a function has a JSNative and get the JSNative of a function

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)

Need this for bug 1131802.
Blocks: 1131802
Comment on attachment 8573963 [details] [diff] [review]
Add friend API to check whether a given function object has a JSNative and to get that JSNative as needed

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

Looks good.

::: js/src/jsfriendapi.h
@@ +2393,5 @@
>  
> +namespace js {
> +
> +static MOZ_ALWAYS_INLINE shadow::Function *
> +FunctionObjectToShadowFunction(JSObject* fun)

Nit: JSObject *fun

@@ +2395,5 @@
> +
> +static MOZ_ALWAYS_INLINE shadow::Function *
> +FunctionObjectToShadowFunction(JSObject* fun)
> +{
> +    MOZ_ASSERT(js::GetObjectClass(fun) == FunctionClassPtr);

Nit: can remove the js:: here.
Attachment #8573963 - Flags: review?(jdemooij) → review+
https://hg.mozilla.org/mozilla-central/rev/5de3c4e663e7
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: