Closed Bug 1449986 Opened 2 years ago Closed 2 years ago

Use NewBuiltinClassInstance instead of NewObjectWithClassProto when proto is nullptr

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file, 1 obsolete file)

Calling |NewObjectWithClassProto(JSContext*, HandleObject proto = nullptr, NewObjectKind newKind = GenericObject)| with an absent |proto| argument is exactly identical to calling |NewBuiltinClassInstance(...)|, except that |NewBuiltinClassInstance(...)| was specifically added to cover the use case when |proto| is always |nullptr|. 

Similar to that case, calling |NewObjectWithClassProto(...)| with an explicit |proto = nullptr| could also be changed to |NewBuiltinClassInstance(...)|.
Priority: -- → P3
Attached patch bug1449986.patch (obsolete) — Splinter Review
Assignee: nobody → andrebargull
Status: NEW → ASSIGNED
Attachment #8975584 - Flags: review?(jorendorff)
Attachment #8975584 - Flags: review?(jorendorff) → review+
Attached patch bug1449986.patchSplinter Review
Rebased to apply cleanly on inbound. Carrying r+.
Attachment #8975584 - Attachment is obsolete: true
Attachment #8993760 - Flags: review+
Pushed by nerli@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1f10db43a17e
Use NewBuiltinClassInstance when requesting default prototype. r=jorendorff
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/1f10db43a17e
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.