Add a warning using nsIDocument::WarnOnceAbout when we allow unwrapping to fail silently

RESOLVED FIXED in mozilla23

Status

()

Core
XPConnect
P2
normal
RESOLVED FIXED
7 years ago
5 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

unspecified
mozilla23
x86
Mac OS X
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

So what this needs is a way to go from a JSObject to an nsIDocument.  I guess I could get the global and hope it's a Window, but do I want |obj| or |callee| to get the global from?
So I can add this but it will have no property name and no line/stack information... so I'm not sure how useful it will be.
Ah, maybe we'll have useful line info somehow by magic!   That certainly makes this a lot more useful!
Created attachment 734269 [details] [diff] [review]
Warn when LenientThis actually causes us to not throw.
Attachment #734269 - Flags: review?(Ms2ger)
Whiteboard: [need review]
Comment on attachment 734269 [details] [diff] [review]
Warn when LenientThis actually causes us to not throw.

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

::: dom/bindings/BindingUtils.cpp
@@ +1691,5 @@
> +void
> +ReportLenientThisUnwrappingFailure(JSContext* cx, JS::Handle<JSObject*> obj)
> +{
> +  GlobalObject glob(cx, obj);
> +  nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(glob.Get());

Nit: I'd have used 'global' and 'window'.
Attachment #734269 - Flags: review?(Ms2ger) → review+
Done, and https://hg.mozilla.org/integration/mozilla-inbound/rev/729177f4b5c8
Flags: in-testsuite?
Whiteboard: [need review]
Target Milestone: --- → mozilla23

Comment 7

5 years ago
https://hg.mozilla.org/mozilla-central/rev/729177f4b5c8
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED

Updated

5 years ago
Depends on: 867863
You need to log in before you can comment on or make changes to this bug.