Closed Bug 928616 Opened 11 years ago Closed 11 years ago

Clean up JS_CopyPropert{ies,y}From Implementation

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: bholley, Assigned: bholley)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

These are followup tasks from bug 911864 comment 39. We want to do two things:

(1) Stop using shapes, and rewrite things in terms of property descriptors.

(2) skip copying JSPropertyOp-implemented properties.
(3) - Add a MOZ_RELEASEMODE_ASSERT to mfbt and use it when checking invariants in these functions.
Depends on: 928636
Attachment #831918 - Flags: review?(jorendorff)
Comment on attachment 831918 [details] [diff] [review]
Clean up JS_CopyPropertiesFrom. v1

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

That's great. Thank you.

::: js/src/jsobj.cpp
@@ +1739,5 @@
> +    JSAutoCompartment ac(cx, target);
> +    RootedId wrappedId(cx, id);
> +    if (!cx->compartment()->wrap(cx, &desc) ||
> +        !cx->compartment()->wrapId(cx, wrappedId.address()))
> +        return false;

Style nit: Needs curly braces around `return false;`, each on its own line. But I usually

    if (!pleaseWork())
        return false;
    if (!pleaseDontFail())
        return false;
Attachment #831918 - Flags: review?(jorendorff) → review+
https://hg.mozilla.org/mozilla-central/rev/73cfaa3c248f
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: