<?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>20023</bug_id>
          
          <creation_ts>2008-07-12 14:36:00 -0700</creation_ts>
          <short_desc>Failed assertion in PropertyNameArray.cpp</short_desc>
          <delta_ts>2008-07-16 01:21:43 -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>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Hansen">david.hansen</reporter>
          <assigned_to name="Alexey Proskuryakov">ap</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>85852</commentid>
    <comment_count>0</comment_count>
    <who name="David Hansen">david.hansen</who>
    <bug_when>2008-07-12 14:36:00 -0700</bug_when>
    <thetext>Just run this little test:

ASSERTION FAILED: identifier == &amp;UString::Rep::null || identifier == &amp;UString::Rep::empty || identifier-&gt;identifierTable
(JavaScriptCore/kjs/PropertyNameArray.cpp:30 void KJS::PropertyNameArray::add(KJS::UString::Rep*))

#include &lt;stdlib.h&gt;
#include &lt;stdbool.h&gt;
#include &lt;JavaScriptCore/JavaScript.h&gt;

static bool
has_prop (JSContextRef jsCtx, JSObjectRef jsObj, JSStringRef jsName)
{
  if (JSStringIsEqualToUTF8CString (jsName, &quot;fourtyTwo&quot;))
    return true;

  return false;
}


static JSValueRef
get_prop (JSContextRef jsCtx, JSObjectRef jsObj,
          JSStringRef jsName, JSValueRef *jsExn)
{
  return JSValueMakeNumber (jsCtx, 42.0);
}

static void
get_prop_names (JSContextRef jsCtx, JSObjectRef jsObj,
                JSPropertyNameAccumulatorRef jsNames)
{
  JSStringRef jsStr = JSStringCreateWithUTF8CString (&quot;fourtyTwo&quot;);

  JSPropertyNameAccumulatorAddName (jsNames, jsStr);
  JSStringRelease (jsStr);
}

int
main (void)
{
  JSClassDefinition  cdef = kJSClassDefinitionEmpty;
  JSClassRef         jsClass;
  JSGlobalContextRef jsCtx;
  JSStringRef        jsScript;

  jsScript = JSStringCreateWithUTF8CString (&quot;var a = [];&quot;
                                            &quot;for (i in this) { a.push[i]; }&quot;);

  cdef.className        = &quot;Foo&quot;;
  cdef.hasProperty      = has_prop;
  cdef.getProperty      = get_prop;
  cdef.getPropertyNames = get_prop_names;

  jsClass = JSClassCreate (&amp;cdef);
  jsCtx   = JSGlobalContextCreate (jsClass);

  /* Boom!  */
  JSEvaluateScript (jsCtx, jsScript, NULL, NULL, 0, NULL);

  return EXIT_SUCCESS;
}

/*
  Local Variables:
  compile-command: &quot;gcc -g -ggdb -O0 -W -Wall \
    `pkg-config --cflags --libs webkit-1.0`   \
    jsaccum.c -o jsaccum&quot;
  End:
*/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85970</commentid>
    <comment_count>1</comment_count>
      <attachid>22290</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-07-15 14:46:43 -0700</bug_when>
    <thetext>Created attachment 22290
proposed fix

/me mutters something about the benefits of type safety</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85979</commentid>
    <comment_count>2</comment_count>
      <attachid>22290</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2008-07-15 15:29:09 -0700</bug_when>
    <thetext>Comment on attachment 22290
proposed fix

To unit test this, you can add some of the code above to testapi.c.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86011</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-07-16 01:21:43 -0700</bug_when>
    <thetext>Committed revision 35196.

Turns out that testapi already exercised this code path - it&apos;s just that no one ran it in a while.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>22290</attachid>
            <date>2008-07-15 14:46:43 -0700</date>
            <delta_ts>2008-07-15 15:29:09 -0700</delta_ts>
            <desc>proposed fix</desc>
            <filename>20023r1_patch.txt</filename>
            <type>text/plain</type>
            <size>1146</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBKYXZhU2NyaXB0
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDM1MTg1KQorKysgSmF2YVNjcmlwdENvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTMgQEAKKzIwMDgtMDctMTUgIEFsZXhleSBQ
cm9za3VyeWFrb3YgIDxhcEB3ZWJraXQub3JnPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9E
WSAoT09QUyEpLgorCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNn
aT9pZD0yMDAyMworICAgICAgICBGYWlsZWQgYXNzZXJ0aW9uIGluIFByb3BlcnR5TmFtZUFycmF5
LmNwcAorCisgICAgICAgICogQVBJL0pTT2JqZWN0UmVmLmNwcDogKEpTUHJvcGVydHlOYW1lQWNj
dW11bGF0b3JBZGROYW1lKTogQWRkIHRoZSBzdHJpbmcgdG8gaWRlbnRpZmllcgorICAgICAgICB0
YWJsZSB0byBhcHBlYWFzZSBQcm9wZXJ0eU5hbWVBcnJheS4KKwogMjAwOC0wNy0xNSAgS2V2aW4g
TWNDdWxsb3VnaCAgPGttY2N1bGxvdWdoQGFwcGxlLmNvbT4KIAogICAgICAgICBSZXZpZXdlZCBi
eSBHZW9mZi4KSW5kZXg6IEphdmFTY3JpcHRDb3JlL0FQSS9KU09iamVjdFJlZi5jcHAKPT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PQotLS0gSmF2YVNjcmlwdENvcmUvQVBJL0pTT2JqZWN0UmVmLmNwcAkocmV2aXNpb24gMzUx
NzkpCisrKyBKYXZhU2NyaXB0Q29yZS9BUEkvSlNPYmplY3RSZWYuY3BwCSh3b3JraW5nIGNvcHkp
CkBAIC00MDQsNSArNDA0LDUgQEAgdm9pZCBKU1Byb3BlcnR5TmFtZUFjY3VtdWxhdG9yQWRkTmFt
ZShKUwogICAgIHByb3BlcnR5TmFtZXMtPmdsb2JhbERhdGEoKS0+aGVhcC0+cmVnaXN0ZXJUaHJl
YWQoKTsKICAgICBKU0xvY2sgbG9jayhwcm9wZXJ0eU5hbWVzLT5nbG9iYWxEYXRhKCktPmlzU2hh
cmVkSW5zdGFuY2UpOwogCi0gICAgcHJvcGVydHlOYW1lcy0+YWRkKHJlcCk7CisgICAgcHJvcGVy
dHlOYW1lcy0+YWRkKElkZW50aWZpZXIocHJvcGVydHlOYW1lcy0+Z2xvYmFsRGF0YSgpLCByZXAp
KTsKIH0K
</data>
<flag name="review"
          id="9805"
          type_id="1"
          status="+"
          setter="ggaren"
    />
          </attachment>
      

    </bug>

</bugzilla>