Closed Bug 1036501 Opened 10 years ago Closed 6 years ago

Don't auto-unwrap scripted direct proxies when calling non-generic functions

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1111243

People

(Reporter: till, Assigned: till)

References

Details

Attachments

(1 file)

As discussed on IRC, we don't want to auto-unwrap scripted proxies when calling non-generic methods. We already don't do this for scripted indirect proxies, and this patch does the same for direct ones.
Blocks: 1021379
Oh, and try-servering here just in case we have code somewhere that relies on this: https://tbpl.mozilla.org/?tree=Try&rev=a7987ee85bbe
Comment on attachment 8453161 [details] [diff] [review]
Don't auto-unwrap scripted direct proxies when calling non-generic functions

Switching reviewer: efaust offered on IRC and has the shorter review queue.
Attachment #8453161 - Flags: review?(jorendorff) → review?(efaustbmo)
Comment on attachment 8453161 [details] [diff] [review]
Don't auto-unwrap scripted direct proxies when calling non-generic functions

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

Looks good. r=me

::: js/src/jsproxy.cpp
@@ +1096,5 @@
>      /* Spidermonkey extensions. */
>      virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) const MOZ_OVERRIDE;
>      virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args) const MOZ_OVERRIDE;
> +    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,
> +                            CallArgs args) const MOZ_OVERRIDE;

Just put the call to BaseProxyHandler::native call inline in the class definition like the other two. We really would love "using" here, but it doesn't play nicely with virtual functions.
Attachment #8453161 - Flags: review?(efaustbmo) → review+
Also fixed in bug 1111243.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: