Closed Bug 486297 Opened 16 years ago Closed 14 years ago

Removal of struct JSProperty definition

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: igor, Assigned: igor)

References

(Blocks 1 open bug)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Currently JSProperty is defined as a struct with the single id member field but the code never dereference JSProperty except in one single place in jsarray.cpp that I added in bug 486106 and that can be trivially avoided. Thus I suggest to remove JSProperty struct definition and just keep it as an opaque pointer typedef. This would also allow to change lookupProperty to return JSProperty instead of using pass-by-the pointer out param. To distinguish a failure from not-found condition the code can simply define (JSProperty *) 1 as a value indicating an error. But this can go to another bug.
Attached patch v1Splinter Review
The patch removes the definition of JSProperty struct and moves its typedef from jspubtd.h to jsprvtd.h .
Attachment #370393 - Flags: review?(brendan)
Attachment #370393 - Flags: review?(brendan) → review?(mrbkap)
Attachment #370393 - Flags: review?(mrbkap) → review+
landed to TM - http://hg.mozilla.org/tracemonkey/rev/bd50ffde19c8 I nominate this for 1.9.1 to make sure on that branch as well that the code never dereference JSProperty. That would immediately leads to bugs due to a usage like (JSProperty *) 1 in liveconnect.
Flags: wanted1.9.1?
Whiteboard: fixed-in-tracemonkey
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Flags: wanted1.9.1?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: