Closed Bug 1487136 Opened 6 years ago Closed 6 years ago

Make OwningCompileOptions::setFile(JSContext*, const char*) MOZ_MUST_USE

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: Waldo, Assigned: Waldo)

Details

Attachments

(1 file)

      No description provided.
Attached patch PatchSplinter Review
You seem to be the most vaguely recent person touching ChromeScriptLoader.cpp who isn't just a SpiderMonkey person rearranging deckchairs.  :-)
Attachment #9004935 - Flags: review?(kmaglione+bmo)
Summary: Make OwningCompileOptions::setFile(JSContext*, const char*) fallible → Make OwningCompileOptions::setFile(JSContext*, const char*) MOZ_MUST_USE
Comment on attachment 9004935 [details] [diff] [review]
Patch

Review of attachment 9004935 [details] [diff] [review]:
-----------------------------------------------------------------

Mandatory Init() methods make me nervous. I generally prefer classes that need them to have private constructors and static Create() methods that return a Result or take an ErrorResult argument. In this case, though, just having Start() setup the compile options might be a better option, though, since it's already fallible.

::: js/xpconnect/loader/ChromeScriptLoader.cpp
@@ +52,5 @@
>        , mScriptLength(0)
> +    {}
> +
> +    MOZ_MUST_USE nsresult Init(JSContext* aCx,
> +                          const nsACString& aURL,

Nit: Please align arguments after opening paren.
Attachment #9004935 - Flags: review?(kmaglione+bmo) → review+
Pushed by jwalden@mit.edu:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0e1dd163d614
Make OwningCompileOptions::setFile(JSContext*, const char*) MOZ_MUST_USE.  r=kmag on fixing the one user requiring any changes, r=me on the obviously-justified attribute-addition
https://hg.mozilla.org/mozilla-central/rev/0e1dd163d614
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: