Closed Bug 1142296 Opened 5 years ago Closed 5 years ago

Remove parent argument from NewObjectWithGivenProto

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

No description provided.
Blocks: 1142304
Comment on attachment 8576306 [details] [diff] [review]
Remove the parent argument from NewObjectWithGivenProto

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

::: js/src/jsscript.cpp
@@ +1355,5 @@
>  
>  ScriptSourceObject *
>  ScriptSourceObject::create(ExclusiveContext *cx, ScriptSource *source)
>  {
> +    RootedObject object(cx, NewObjectWithGivenProto(cx, &class_, NullPtr()));

Seems like a bunch of these that pass a constant class should use NewObjectWithGivenProto<T> instead, maybe.  (Or maybe we could imagine that class is constant everywhere, because variable class is just weird?  Excepting maybe in JSAPI function spots.)
Attachment #8576306 - Flags: review?(jwalden+bmo) → review+
> Seems like a bunch of these that pass a constant class should use
> NewObjectWithGivenProto<T> instead, maybe.

Could be.  I can't tell what the rhyme/reason behind these baroque newobject APIs is.... :(
Depends on: 1141905
https://hg.mozilla.org/mozilla-central/rev/b105c303ca33
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Duplicate of this bug: 567887
You need to log in before you can comment on or make changes to this bug.