Closed Bug 1163423 Opened 5 years ago Closed 5 years ago

Introduce JS_HasOwnProperty

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: evilpie, Assigned: evilpie)

References

(Blocks 2 open bugs)

Details

(Keywords: dev-doc-needed)

Attachments

(2 files)

Attached patch has-ownSplinter Review
We already have JS_AlreayHasOwnProperty, but that function doesn't call resolve hooks. Maybe worth looking into if we can remove it.
Attachment #8603865 - Flags: review?(bhackett1024)
Assignee: nobody → evilpies
Status: NEW → ASSIGNED
Attachment #8603866 - Flags: review?(wmccloskey)
Blocks: 1160996
Keywords: dev-doc-needed
Attachment #8603865 - Flags: review?(bhackett1024) → review+
> Maybe worth looking into if we can remove it.

So looking at consumers of JS_AlreadyHasOwnProperty(ById):

1)  DOMProxyShadows is using it on the expando, so could use JS_HasOwnPropertyById.  Assuming that's not slower, of course.

2)  In DefineConstructor, I'm not exactly sure why we need that check.  It might be possible to remove it, if we know that the global's resolve hook will always resolve the relevant properties before someone has a chance to redefine them.

3)  Plugin code, no idea.  But those objects _do_ have resolve hooks, so need to check carefully.

4)  XBL, pretty sure is working on objects with no resolve hooks only.

5)  Xrays, working with holder objects, which have no resolve hook.
Blocks: 1139351
Attachment #8603866 - Flags: review?(wmccloskey) → review+
No longer blocks: 1139351
Blocks: 1163746
You need to log in before you can comment on or make changes to this bug.