<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>146931</bug_id>
          
          <creation_ts>2015-07-14 08:05:56 -0700</creation_ts>
          <short_desc>Defining non-enumerable, non-numeric property breaks for (key in obj) on enumerable, numeric properties</short_desc>
          <delta_ts>2015-07-15 14:50:12 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>mark.s.dittmer</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1109360</commentid>
    <comment_count>0</comment_count>
    <who name="">mark.s.dittmer</who>
    <bug_when>2015-07-14 08:05:56 -0700</bug_when>
    <thetext>This was originally discovered on arrays, but I have since determined that it breaks objects in general. I&apos;m writing a test inline because I&apos;m not sure whether it should be a JavaScriptCore test or LayoutTest.

Test code:

var obj = { 0: 0, 1: 1, _2: 2 };
Object.defineProperty(obj, &apos;_3&apos;, {});
for (var key in obj) console.log(key);

Test output:

0
1
0
1
_2

Testing notes:
- Problem occurs on arrays as well as Objects (given that it occurs on plain-old objects, this is not surprising)
- Problem occurs with Object.defineProperty and Object.defineProperties under the same conditions
- Problem only occurs when the newly define property is both non-numeric and non-enumerable (other property attributes do not appear to influence the outcome)
- The only keys that duplicate themselves are numeric keys (that are enumerable)
- Problem does not occur in return value of Object.keys(obj)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>