Changeset 33972 in webkit for trunk/JavaScriptCore/kjs/function.h


Ignore:
Timestamp:
May 21, 2008, 12:15:01 PM (17 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

2008-05-21 Darin Adler <Darin Adler>

Reviewed by Anders.

  • fix <rdar://problem/5952721> bug in JavaScript arguments object property lookup

Test: fast/js/arguments-bad-index.html

  • kjs/function.cpp: (KJS::IndexToNameMap::IndexToNameMap): Use unsigned instead of int. (KJS::IndexToNameMap::isMapped): Use unsigned instead of int, and also use the strict version of the numeric conversion function, since we don't want to allow trailing junk. (KJS::IndexToNameMap::unMap): Ditto. (KJS::IndexToNameMap::operator[]): Ditto.
  • kjs/function.h: Changed IndexToNameMap::size type from int to unsigned.

LayoutTests:

2008-05-21 Darin Adler <Darin Adler>

Reviewed by Anders.

  • test for <rdar://problem/5952721> bug in JavaScript arguments object property lookup
  • fast/js/arguments-bad-index-expected.txt: Added.
  • fast/js/arguments-bad-index.html: Added.
  • fast/js/resources/arguments-bad-index.js: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/function.h

    r32259 r33972  
    9494  class IndexToNameMap {
    9595  public:
    96     IndexToNameMap(FunctionImp* func, const List& args);
     96    IndexToNameMap(FunctionImp*, const List& args);
    9797    ~IndexToNameMap();
    9898   
    99     Identifier& operator[](int index);
    100     Identifier& operator[](const Identifier &indexIdentifier);
     99    Identifier& operator[](const Identifier& index);
    101100    bool isMapped(const Identifier& index) const;
    102101    void unMap(const Identifier& index);
    103102   
    104103  private:
    105     IndexToNameMap(); // prevent construction w/o parameters
    106     int size;
     104    unsigned size;
    107105    Identifier* _map;
    108106  };
Note: See TracChangeset for help on using the changeset viewer.