Last Comment Bug 708253 - Use IDL for Components.(utils.)reportError
: Use IDL for Components.(utils.)reportError
Product: Core
Classification: Components
Component: XPConnect (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla11
Assigned To: :Ms2ger (⌚ UTC+1/+2)
: Andrew Overholt [:overholt]
Depends on:
  Show dependency treegraph
Reported: 2011-12-07 08:15 PST by :Ms2ger (⌚ UTC+1/+2)
Modified: 2011-12-18 07:19 PST (History)
1 user (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch v1 (8.87 KB, patch)
2011-12-07 08:15 PST, :Ms2ger (⌚ UTC+1/+2)
bobbyholley: review+
Details | Diff | Splinter Review

Description User image :Ms2ger (⌚ UTC+1/+2) 2011-12-07 08:15:13 PST
Created attachment 579691 [details] [diff] [review]
Patch v1
Comment 1 User image Bobby Holley (:bholley) (busy with Stylo) 2011-12-07 12:28:27 PST
Comment on attachment 579691 [details] [diff] [review]
Patch v1

>+    [deprecated,implicit_jscontext] void reportError(in jsval error);

I think we could use a space between the attributes (above as well).

>+nsXPCComponents_Utils::ReportError(const JS::Value& error, JSContext* cx)

The star and ampersand should be fixed (in a few other places as well).

>-    JSString* msgstr = JS_ValueToString(cx, argv[0]);

For a second there, I thought you were naming a variable after yourself. ;-)

>+    NS_ENSURE_SUCCESS(scripterr->InitWithWindowID(
>+            reinterpret_cast<const PRUnichar *>(msgchars),
>+            NS_ConvertUTF8toUTF16(fileName).get(),
>+            nsnull, lineNo, 0, 0, "XPConnect JavaScript", innerWindowID),
>+        NS_OK);

I'm not really a fan of this, because I find it jarring to see non-error-handing code wrapped up on an NS_ENSURE_* macro. I'd prefer to use an rv, and do NS_ENSURE_SUCCESS(rv, NS_OK).

r=bholley with that.
Comment 2 User image :Ms2ger (⌚ UTC+1/+2) 2011-12-18 07:19:49 PST

Note You need to log in before you can comment on or make changes to this bug.