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 (away until August 15)
:
Mentors:
Depends on:
Blocks: nsresult-enum-class
  Show dependency treegraph
 
Reported: 2012-08-14 05:11 PDT by :Aryeh Gregor (away until August 15)
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 (away until August 15)
khuey: review+
Details | Diff | Review

Description :Aryeh Gregor (away until August 15) 2012-08-14 05:11:11 PDT

    
Comment 1 :Aryeh Gregor (away until August 15) 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 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.