Ignore:
Timestamp:
Oct 26, 2006, 9:39:00 AM (19 years ago)
Author:
darin
Message:

JavaScriptCore:

Reviewed by John.

  • fix iteration of properties of string objects (found because of a warning emitted by the MSVC compiler)
  • kjs/string_object.cpp: (StringInstance::getPropertyNames): Change code that wants to format a number as a string to use UString::from. Before it was using the UString constructor that makes a string from a character!
  • kjs/ustring.h:
  • kjs/ustring.cpp: Remove the dangerous and not all that helpful UString(char) constructor.
  • kjs/grammar.y: Change code to not depend on the UString(char) constructor. This is potentially more efficient anyway because we could overload the + operator some day to handle char* directly instead of creating a UString.
  • kjs/nodes2string.cpp: (SourceStream::operator<<): Change code to not depend on the UString(char) constructor.

LayoutTests:

Reviewed by John.

  • add a test for iteration of properties of string objects
  • fast/js/resources/string-property-iteration.js: Added.
  • fast/js/string-property-iteration-expected.txt: Added.
  • fast/js/string-property-iteration.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/string_object.cpp

    r15846 r17306  
    100100  int size = internalValue()->getString().size();
    101101  for (int i = 0; i < size; i++)
    102     propertyNames.add(Identifier(UString(i)));
     102    propertyNames.add(Identifier(UString::from(i)));
    103103  return JSObject::getPropertyNames(exec, propertyNames);
    104104}
Note: See TracChangeset for help on using the changeset viewer.