Bug 28811 - callee and length properties of arguments object are missing the DontEnum attribute
Summary: callee and length properties of arguments object are missing the DontEnum att...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-28 07:43 PDT by Kent Hansen
Modified: 2009-11-27 06:16 PST (History)
2 users (show)

See Also:


Attachments
Proposed patch (1.46 KB, patch)
2009-08-28 07:45 PDT, Kent Hansen
ggaren: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Hansen 2009-08-28 07:43:47 PDT
According to ECMA-262, section 10.1.8, the callee and length properties have attributes { DontEnum }.
Comment 1 Kent Hansen 2009-08-28 07:45:44 PDT
Created attachment 38736 [details]
Proposed patch
Comment 2 Geoffrey Garen 2009-08-28 11:05:44 PDT
Comment on attachment 38736 [details]
Proposed patch

Code looks good.

However, please supply a ChangeLog and a regression test verifying this behavior.

More info @ http://webkit.org/coding/contributing.html.
Comment 3 Oliver Hunt 2009-08-28 11:31:56 PDT
Comment on attachment 38736 [details]
Proposed patch

Why is this necessary? for..in does not enumerate the properties on arguments, getOwnPropertyDescriptor also reports it as false.
Comment 4 Geoffrey Garen 2009-08-28 11:39:21 PDT
I think the problem is that propertyIsEnumerable would return true, but should return false.

I think the best way to fix this is to remove all use and implementation of getPropertyAttributes, and change propertyIsEnumerable to call getPropertyDescriptor instead.
Comment 5 Kent Hansen 2009-08-31 05:53:39 PDT
(In reply to comment #3)
> (From update of attachment 38736 [details])
> Why is this necessary? for..in does not enumerate the properties on arguments,
> getOwnPropertyDescriptor also reports it as false.

(In reply to comment #4)
> I think the problem is that propertyIsEnumerable would return true, but should
> return false.
> 
> I think the best way to fix this is to remove all use and implementation of
> getPropertyAttributes, and change propertyIsEnumerable to call
> getPropertyDescriptor instead.

Agreed.
I originally did the patch before https://bugs.webkit.org/show_bug.cgi?id=28724 was fixed, and as Oliver said, getOwnPropertyDescriptor does the right thing already.
Comment 6 Kent Hansen 2009-11-27 06:16:57 PST
Following up on Geoffrey's recommended solution, created https://bugs.webkit.org/show_bug.cgi?id=31933