Comment #28 on issue 883 by nulldevice.eu: for in loops don't occur in  
defined order
http://code.google.com/p/chromium/issues/detail?id=883

So, the mystery is solved... it's not the suspected property address  
caching (yeah!),
but a if/else construct that appears throughout runtime.cc. The comment in
GetObjectProperty basically tells everything. Nevertheless Chrome is a  
great browser.
Just let me state, that I don't consider this copy&paste stuff good coding  
style nor
am I satisfied with the feedback from Google for this ticket... basically I  
posted
the same problem as #223, but it took a Mr Resig to escalate the issue and  
not even
that resulted in a fix. What you need here is a refactoring of the code, to  
get it
really fixed in a way that is compatible to other browsers. And maybe some  
more
useful comments like SquirrelFish :)

GetObjectProperty (line 2559):

   // Check if the name is trivially convertible to an index and get
   // the element if so.
   if (name->AsArrayIndex(&index)) {
     return GetElementOrCharAt(object, index);
   } else {
     PropertyAttributes attr;
     return object->GetProperty(*name, &attr);
   }

SetObjectProperty (line 2670):

   if (key->IsString()) {
     Handle<Object> result;
     if (Handle<String>::cast(key)->AsArrayIndex(&index)) {
       ASSERT(attr == NONE);
       result = SetElement(js_object, index, value);
     } else {
       Handle<String> key_string = Handle<String>::cast(key);
       key_string->TryFlattenIfNotFlat();
       result = SetProperty(js_object, key_string, value, attr);
     }
     if (result.is_null()) return Failure::Exception();
     return *value;
   }

Keep up the good work!

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to