Last Comment Bug 782606 - Use NS_FAILED instead of boolean test (dom/indexedDB/, dom/workers/)
: Use NS_FAILED instead of boolean test (dom/indexedDB/, dom/workers/)
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- minor (vote)
: mozilla17
Assigned To: Aryeh Gregor (:ayg) (next working March 28-April 26)
:
: Andrew Overholt [:overholt]
Mentors:
Depends on:
Blocks: nsresult-enum-class
  Show dependency treegraph
 
Reported: 2012-08-14 05:11 PDT by Aryeh Gregor (:ayg) (next working March 28-April 26)
Modified: 2012-08-16 17:58 PDT (History)
1 user (show)
ayg: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (4.30 KB, patch)
2012-08-14 05:15 PDT, Aryeh Gregor (:ayg) (next working March 28-April 26)
khuey: review+
Details | Diff | Splinter Review

Description Aryeh Gregor (:ayg) (next working March 28-April 26) 2012-08-14 05:11:11 PDT

    
Comment 1 Aryeh Gregor (:ayg) (next working March 28-April 26) 2012-08-14 05:15:03 PDT
Created attachment 651709 [details] [diff] [review]
Patch

Testing an nsresult as a boolean isn't correct use of nsresult -- there are success codes other than NS_OK.  (Although maybe there shouldn't be!)  This will no longer compile when nsresult is an enum class, because enum classes can't be implicitly converted to other types.

This shouldn't change behavior as long as nothing here uses success codes other than NS_OK.  I wasn't able to easily verify that was the case here, but it seems likely.
Comment 2 Aryeh Gregor (:ayg) (next working March 28-April 26) 2012-08-16 05:59:51 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/11d577df701f

Green try: https://tbpl.mozilla.org/?tree=Try&rev=da4047717ef7
Comment 3 Ryan VanderMeulen [:RyanVM] 2012-08-16 17:58:14 PDT
https://hg.mozilla.org/mozilla-central/rev/11d577df701f

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