Closed Bug 688691 Opened 14 years ago Closed 12 years ago

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

Categories

(Core :: XPConnect, defect, P2)

x86
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

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!
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+
Flags: in-testsuite?
Whiteboard: [need review]
Target Milestone: --- → mozilla23
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Depends on: 867863
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: