Closed Bug 513428 Opened 15 years ago Closed 15 years ago

JS_IsArrayObject should call js_GetWrappedObject

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2
Tracking Status
status1.9.2 --- beta4-fixed

People

(Reporter: mrbkap, Assigned: mrbkap)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

This is needed for more transparency in transparent wrappers.
Attached patch FixSplinter Review
This also fixes Array.isArray().
Assignee: general → mrbkap
Status: NEW → ASSIGNED
Attachment #397431 - Flags: review?(brendan)
Comment on attachment 397431 [details] [diff] [review]
Fix

Sure -- only thought is to make a js_IsArrayObject static inline helper in jsarray.h to common the OBJ_IS_ARRAY(cx, js_GetWrappedObject(cx, ...)).

/be
Attachment #397431 - Flags: review?(brendan) → review+
Inline JSObject::isArray?
(In reply to comment #3)
> Inline JSObject::isArray?

Modularity wants it in jsarray.h, which includes jsobj.h and defines OBJ_IS_ARRAY and declares the extern JSClass instances. Does it work to declare an inline in JSObject in jsobj.h but define the same inline in jsarray.h, and files that never include jsarray.h and of course never call obj->isArray won't mind?

/be
Is it worth it? Looking at other uses of OBJ_IS_ARRAY, these two appear to be unique.
Hm, maybe not.  Replacing the non-unwrapping version is more interesting to me, and that's not really for here and now.
http://hg.mozilla.org/tracemonkey/rev/64c10219c320
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/64c10219c320
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
blake, do we want this on 1.9.2?
Flags: wanted1.9.2?
Yeah, I think we do.
Comment on attachment 397431 [details] [diff] [review]
Fix

This makes wrappers more transparent and might fix bug 525736.
Attachment #397431 - Flags: approval1.9.2?
Any chance this will make it to branch? If not I'll just work around it for bug 525736.
I would argue that we want this no matter what. It breaks JSON-serialization of any array that is wrapped (or any object that contains such an array of course).
Attachment #397431 - Flags: approval1.9.2? → approval1.9.2+
Flags: wanted1.9.2?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: