Closed Bug 677703 Opened 13 years ago Closed 13 years ago

Add element-valued property methods to ObjectOps

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla9

People

(Reporter: Waldo, Assigned: Waldo)

Details

Attachments

(1 file)

This extends the element-based APIs downward from the JSAPI.  They won't be used now, generally (except in rare cases), but they'll be present and can be improved up to par with existing code before the element/non-element split becomes a fundamental part of property storage.

This is a lot of patch, but it is *very* easy to verify, because the element methods just funnel to the jsid methods right now.  I'll change that and optimize that in future bugs and/or patches.
Attachment #551899 - Flags: review?(cdleary)
Comment on attachment 551899 [details] [diff] [review]
Add element versions of all the ObjectOps property methods, directly forwarding to the jsid versions for now

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

::: js/src/jsapi.h
@@ +1976,4 @@
>      JSTraceOp           trace;
>  
>      JSClassInternal     reserved1;
> +    void                *reserved[28];

19 + 7 new object ops = 26? Otherwise I'm confused, and could use a clarifying reply.

::: js/src/jsarray.cpp
@@ +883,4 @@
>      return js_DefineProperty(cx, obj, id, value, getter, setter, attrs);
>  }
>  
> +JSBool

Can we add the reason why this isn't static as a comment?

@@ +954,4 @@
>      return JS_TRUE;
>  }
>  
> +JSBool

Ditto.

::: js/src/jsobj.cpp
@@ +3116,5 @@
> +{
> +    jsid id;
> +    if (!IndexToId(cx, index, &id))
> +        return false;
> +    return with_SetElement(cx, obj, index, vp, strict);

Infinite recursion.
Attachment #551899 - Flags: review?(cdleary) → review+
http://hg.mozilla.org/integration/mozilla-inbound/rev/b221c62a19c3
Whiteboard: [inbound]
Target Milestone: --- → mozilla9
http://hg.mozilla.org/mozilla-central/rev/b221c62a19c3
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: