Report in NS_WARNING output for which contract id it failed to load the JS implementation (BindingUtils.cpp)

RESOLVED FIXED in mozilla36

Status

()

Core
DOM
--
minor
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: mcsmurf, Assigned: bz)

Tracking

Trunk
mozilla36
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
This is basically related to Bug 876602.
Before the patch in that bug the warning message (NS_WARNING) reported the contract id when a JS implementation failed to load:
-    nsCOMPtr<nsISupports> implISupports = do_CreateInstance("${contractId}");
-    if (!implISupports) {
-      NS_WARNING("Failed to get JS implementation for contract \\"${contractId}\\"");
-      aRv.Throw(NS_ERROR_FAILURE);
-      return nullptr;
-    }

The new code in BindingUtils.cpp does not do that:
+    nsCOMPtr<nsISupports> implISupports = do_CreateInstance(aContractId);
+    if (!implISupports) {
+      NS_WARNING("Failed to get JS implementation for contract");
+      aRv.Throw(NS_ERROR_FAILURE);
+      return nullptr;
+    }

I think it should still be possible (and helpful) to add the contract id to the warning text here?
Created attachment 8526214 [details] [diff] [review]
Warning when failing to create a JS implemntation for a Web IDL binding should include the implementation contract
Attachment #8526214 - Flags: review?(peterv)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #8526214 - Flags: review?(peterv) → review+
https://hg.mozilla.org/mozilla-central/rev/d2beb971bb6e
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.