Removal of struct JSProperty definition

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
9 years ago
6 years ago

People

(Reporter: Igor Bukanov, Assigned: Igor Bukanov)

Tracking

(Blocks: 1 bug)

Other Branch
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 attachment)

(Assignee)

Description

9 years ago
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.
(Assignee)

Comment 1

9 years ago
Created attachment 370393 [details] [diff] [review]
v1

The patch removes the definition of JSProperty struct and moves its typedef from jspubtd.h to jsprvtd.h .
Attachment #370393 - Flags: review?(brendan)
(Assignee)

Updated

9 years ago
Attachment #370393 - Flags: review?(brendan) → review?(mrbkap)

Updated

9 years ago
Attachment #370393 - Flags: review?(mrbkap) → review+
(Assignee)

Comment 2

9 years ago
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
http://hg.mozilla.org/mozilla-central/rev/bd50ffde19c8
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
(Assignee)

Updated

6 years ago
Flags: wanted1.9.1?
You need to log in before you can comment on or make changes to this bug.