Changeset 8904 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Mar 16, 2005, 10:30:25 AM (20 years ago)
Author:
jens
Message:

[4025212] search not performed correctly; united.com. Fixed bug inherited from KJS that caused unescape() of an empty string to return a messed-up String object that would sometimes act like the value 'null'.

Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r8896 r8904  
     12005-03-16  Jens Alfke  <[email protected]>
     2
     3        Reviewed by Kevin.
     4
     5        Fix for <rdar://problem/4025212> "REGRESSION (163-164): search not performed correctly; united.com"
     6        JavaScript unescape("") was returning a messed-up String object that appeared identical to an empty string, but would in some cases act as 'null' when passed to native functions, in this case the Option() constructor.
     7        In the implementation of unescape, the UString holding the result was not initialized to "", so it started out as a null string. If nothing was appended to it, it remained null, resulting in a JavaScript String object with some bad behaviors (namely, converting it to a DOMStringImpl results in a NULL pointer.)
     8        Darin says this regression occurred when we replaced our own implementation of unescape() with code from KJS.
     9
     10        * kjs/function.cpp:
     11        (KJS::GlobalFuncImp::call):
     12
    1132005-03-15  Richard Williamson   <[email protected]>
    214
  • trunk/JavaScriptCore/kjs/function.cpp

    r7558 r8904  
    735735  case UnEscape:
    736736    {
    737       UString s, str = args[0].toString(exec);
     737      UString s = "", str = args[0].toString(exec);
    738738      int k = 0, len = str.size();
    739739      while (k < len) {
Note: See TracChangeset for help on using the changeset viewer.