Changeset 34843 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Jun 27, 2008, 9:29:48 PM (17 years ago)
Author:
[email protected]
Message:

2008-06-27 Sam Weinig <[email protected]>

Rubber-stamped by Oliver Hunt.

Splits ArrayConstructor out of ArrayPrototype.h/cpp
Splits BooleanConstructor and BooleanPrototype out of BooleanObject.h/cpp

  • GNUmakefile.am:
  • JavaScriptCore.pri:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • JavaScriptCoreSources.bkl:
  • VM/Machine.cpp:
  • kjs/AllInOneFile.cpp:
  • kjs/ArrayConstructor.cpp: Copied from kjs/ArrayPrototype.cpp.
  • kjs/ArrayConstructor.h: Copied from kjs/ArrayPrototype.h.
  • kjs/ArrayPrototype.cpp:
  • kjs/ArrayPrototype.h:
  • kjs/BooleanConstructor.cpp: Copied from kjs/BooleanObject.cpp.
  • kjs/BooleanConstructor.h: Copied from kjs/BooleanObject.h.
  • kjs/BooleanObject.cpp:
  • kjs/BooleanObject.h:
  • kjs/BooleanPrototype.cpp: Copied from kjs/BooleanObject.cpp.
  • kjs/BooleanPrototype.h: Copied from kjs/BooleanObject.h.
  • kjs/CommonIdentifiers.h:
  • kjs/FunctionPrototype.cpp:
  • kjs/JSArray.cpp:
  • kjs/JSGlobalObject.cpp:
  • kjs/JSImmediate.cpp:
  • kjs/Shell.cpp:
  • kjs/internal.cpp:
  • kjs/nodes.cpp:
  • kjs/string_object.cpp:
Location:
trunk/JavaScriptCore
Files:
21 edited
6 copied

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r34842 r34843  
     12008-06-27  Sam Weinig  <[email protected]>
     2
     3        Rubber-stamped by Oliver Hunt.
     4
     5        Splits ArrayConstructor out of ArrayPrototype.h/cpp
     6        Splits BooleanConstructor and BooleanPrototype out of BooleanObject.h/cpp
     7
     8        * GNUmakefile.am:
     9        * JavaScriptCore.pri:
     10        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
     11        * JavaScriptCore.xcodeproj/project.pbxproj:
     12        * JavaScriptCoreSources.bkl:
     13        * VM/Machine.cpp:
     14        * kjs/AllInOneFile.cpp:
     15        * kjs/ArrayConstructor.cpp: Copied from kjs/ArrayPrototype.cpp.
     16        * kjs/ArrayConstructor.h: Copied from kjs/ArrayPrototype.h.
     17        * kjs/ArrayPrototype.cpp:
     18        * kjs/ArrayPrototype.h:
     19        * kjs/BooleanConstructor.cpp: Copied from kjs/BooleanObject.cpp.
     20        * kjs/BooleanConstructor.h: Copied from kjs/BooleanObject.h.
     21        * kjs/BooleanObject.cpp:
     22        * kjs/BooleanObject.h:
     23        * kjs/BooleanPrototype.cpp: Copied from kjs/BooleanObject.cpp.
     24        * kjs/BooleanPrototype.h: Copied from kjs/BooleanObject.h.
     25        * kjs/CommonIdentifiers.h:
     26        * kjs/FunctionPrototype.cpp:
     27        * kjs/JSArray.cpp:
     28        * kjs/JSGlobalObject.cpp:
     29        * kjs/JSImmediate.cpp:
     30        * kjs/Shell.cpp:
     31        * kjs/internal.cpp:
     32        * kjs/nodes.cpp:
     33        * kjs/string_object.cpp:
     34
    1352008-06-27  Oliver Hunt  <[email protected]>
    236
  • trunk/JavaScriptCore/GNUmakefile.am

    r34840 r34843  
    8686        JavaScriptCore/kjs/PropertyNameArray.cpp \
    8787        JavaScriptCore/kjs/JSArray.cpp \
     88        JavaScriptCore/kjs/ArrayConstructor.cpp \
    8889        JavaScriptCore/kjs/ArrayPrototype.cpp \
     90        JavaScriptCore/kjs/BooleanConstructor.cpp \
    8991        JavaScriptCore/kjs/BooleanObject.cpp \
     92        JavaScriptCore/kjs/BooleanPrototype.cpp \
    9093        JavaScriptCore/kjs/collector.cpp \
    9194        JavaScriptCore/kjs/date_object.cpp \
  • trunk/JavaScriptCore/JavaScriptCore.pri

    r34840 r34843  
    6868    kjs/debugger.cpp \
    6969    kjs/JSArray.cpp \
     70    kjs/ArrayConstructor.cpp \
    7071    kjs/ArrayPrototype.cpp \
     72    kjs/BooleanConstructor.cpp \
    7173    kjs/BooleanObject.cpp \
     74    kjs/BooleanPrototype.cpp \
    7275    kjs/collector.cpp \
    7376    kjs/CommonIdentifiers.cpp \
  • trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj

    r34839 r34843  
    274274                        </File>
    275275                        <File
     276                                RelativePath="..\..\kjs\ArrayConstructor.cpp"
     277                                >
     278                        </File>
     279                        <File
     280                                RelativePath="..\..\kjs\ArrayConstructor.h"
     281                                >
     282                        </File>
     283                        <File
    276284                                RelativePath="..\..\kjs\ArrayPrototype.cpp"
    277285                                >
     
    282290                        </File>
    283291                        <File
     292                                RelativePath="..\..\kjs\BooleanConstructor.cpp"
     293                                >
     294                        </File>
     295                        <File
     296                                RelativePath="..\..\kjs\BooleanConstructor.h"
     297                                >
     298                        </File>
     299                        <File
    284300                                RelativePath="..\..\kjs\BooleanObject.cpp"
    285301                                >
     
    287303                        <File
    288304                                RelativePath="..\..\kjs\BooleanObject.h"
     305                                >
     306                        </File>
     307                        <File
     308                                RelativePath="..\..\kjs\BooleanPrototype.cpp"
     309                                >
     310                        </File>
     311                        <File
     312                                RelativePath="..\..\kjs\BooleanPrototype.h"
    289313                                >
    290314                        </File>
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r34838 r34843  
    225225                A8E894320CD0602400367179 /* JSCallbackObjectFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */; };
    226226                A8E894340CD0603F00367179 /* JSGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894330CD0603F00367179 /* JSGlobalObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
     227                BC7952090E15E8A800A898AB /* ArrayConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7952070E15E8A800A898AB /* ArrayConstructor.h */; };
    227228                BC8F3CED0DAF1A8000577A80 /* ConstructData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8F3CCF0DAF17BA00577A80 /* ConstructData.h */; settings = {ATTRIBUTES = (Private, ); }; };
    228229                BCF655590A2049710038A194 /* MathExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF6553B0A2048DE0038A194 /* MathExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    584585                A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCallbackObjectFunctions.h; sourceTree = "<group>"; };
    585586                A8E894330CD0603F00367179 /* JSGlobalObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObject.h; sourceTree = "<group>"; };
     587                BC7952060E15E8A800A898AB /* ArrayConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArrayConstructor.cpp; sourceTree = "<group>"; };
     588                BC7952070E15E8A800A898AB /* ArrayConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayConstructor.h; sourceTree = "<group>"; };
     589                BC7952320E15EB5600A898AB /* BooleanConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BooleanConstructor.cpp; sourceTree = "<group>"; };
     590                BC7952330E15EB5600A898AB /* BooleanConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BooleanConstructor.h; sourceTree = "<group>"; };
     591                BC7952340E15EB5600A898AB /* BooleanPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BooleanPrototype.cpp; sourceTree = "<group>"; };
     592                BC7952350E15EB5600A898AB /* BooleanPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BooleanPrototype.h; sourceTree = "<group>"; };
    586593                BC8F3CCF0DAF17BA00577A80 /* ConstructData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstructData.h; sourceTree = "<group>"; };
    587594                BCF6553B0A2048DE0038A194 /* MathExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MathExtras.h; sourceTree = "<group>"; };
     
    978985                        isa = PBXGroup;
    979986                        children = (
    980                                 65E866ED0DD59AFA00A2B2A1 /* SourceProvider.h */,
    981                                 65E866EE0DD59AFA00A2B2A1 /* SourceRange.h */,
    982987                                659126BC0BDD1728001921FB /* AllInOneFile.cpp */,
    983                                 93ADFCE60CCBD7AC00D30B08 /* JSArray.cpp */,
    984                                 938772E5038BFE19008635CE /* JSArray.h */,
     988                                BC7952060E15E8A800A898AB /* ArrayConstructor.cpp */,
     989                                BC7952070E15E8A800A898AB /* ArrayConstructor.h */,
    985990                                F692A84D0255597D01FF60F7 /* ArrayPrototype.cpp */,
    986991                                F692A84E0255597D01FF60F7 /* ArrayPrototype.h */,
     992                                BC7952320E15EB5600A898AB /* BooleanConstructor.cpp */,
     993                                BC7952330E15EB5600A898AB /* BooleanConstructor.h */,
    987994                                F692A8500255597D01FF60F7 /* BooleanObject.cpp */,
    988995                                704FD35305697E6D003DBED9 /* BooleanObject.h */,
     996                                BC7952340E15EB5600A898AB /* BooleanPrototype.cpp */,
     997                                BC7952350E15EB5600A898AB /* BooleanPrototype.h */,
    989998                                145C507F0D9DF63B0088F6B9 /* CallData.h */,
    990999                                F692A8520255597D01FF60F7 /* collector.cpp */,
     
    10081017                                14BD53F40A3E12D800BAF59C /* ExecState.cpp */,
    10091018                                14BD53F30A3E12D800BAF59C /* ExecState.h */,
    1010                                 F692A85E0255597D01FF60F7 /* JSFunction.cpp */,
    1011                                 F692A85F0255597D01FF60F7 /* JSFunction.h */,
    10121019                                F692A85C0255597D01FF60F7 /* FunctionPrototype.cpp */,
    10131020                                F692A85D0255597D01FF60F7 /* FunctionPrototype.h */,
     
    10181025                                E178633F0D9BEC0000D74E75 /* InitializeThreading.h */,
    10191026                                F692A8610255597D01FF60F7 /* internal.cpp */,
    1020                                 F692A8620255597D01FF60F7 /* JSString.h */,
    10211027                                F692A8630255597D01FF60F7 /* interpreter.cpp */,
    10221028                                F692A8640255597D01FF60F7 /* interpreter.h */,
    10231029                                14DA818F0D99FD2000B0A4FB /* JSActivation.cpp */,
    10241030                                14DA818E0D99FD2000B0A4FB /* JSActivation.h */,
     1031                                93ADFCE60CCBD7AC00D30B08 /* JSArray.cpp */,
     1032                                938772E5038BFE19008635CE /* JSArray.h */,
     1033                                F692A85E0255597D01FF60F7 /* JSFunction.cpp */,
     1034                                F692A85F0255597D01FF60F7 /* JSFunction.h */,
     1035                                E18E3A570DF9278C00D90B34 /* JSGlobalData.cpp */,
    10251036                                E18E3A560DF9278C00D90B34 /* JSGlobalData.h */,
    1026                                 E18E3A570DF9278C00D90B34 /* JSGlobalData.cpp */,
    10271037                                14DE0D680D02431400AACCA2 /* JSGlobalObject.cpp */,
    10281038                                A8E894330CD0603F00367179 /* JSGlobalObject.h */,
     
    10311041                                65EA4C99092AF9E20093D800 /* JSLock.cpp */,
    10321042                                65EA4C9A092AF9E20093D800 /* JSLock.h */,
     1043                                A72700780DAC605600E548D7 /* JSNotAnObject.cpp */,
     1044                                A72700770DAC605600E548D7 /* JSNotAnObject.h */,
     1045                                F692A8750255597D01FF60F7 /* JSObject.cpp */,
     1046                                F692A8760255597D01FF60F7 /* JSObject.h */,
     1047                                F692A8620255597D01FF60F7 /* JSString.h */,
    10331048                                14ABB454099C2A0F00E2A24F /* JSType.h */,
    1034                                 14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */,
     1049                                F692A8870255597D01FF60F7 /* JSValue.cpp */,
     1050                                14ABB36E099C076400E2A24F /* JSValue.h */,
    10351051                                14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */,
    10361052                                14F252560D08DD8D004ECFFF /* JSVariableObject.h */,
     
    10671083                                9374D3A7038D9D74008635CE /* ScopeChain.h */,
    10681084                                7E2C6C980D31C6B6002D44E2 /* ScopeChainMark.h */,
     1085                                65E866ED0DD59AFA00A2B2A1 /* SourceProvider.h */,
     1086                                65E866EE0DD59AFA00A2B2A1 /* SourceRange.h */,
    10691087                                F692A87F0255597D01FF60F7 /* string_object.cpp */,
    10701088                                F692A8800255597D01FF60F7 /* string_object.h */,
     
    10721090                                F692A8850255597D01FF60F7 /* ustring.cpp */,
    10731091                                F692A8860255597D01FF60F7 /* ustring.h */,
    1074                                 F692A8870255597D01FF60F7 /* JSValue.cpp */,
    1075                                 14ABB36E099C076400E2A24F /* JSValue.h */,
    1076                                 A72700770DAC605600E548D7 /* JSNotAnObject.h */,
    1077                                 A72700780DAC605600E548D7 /* JSNotAnObject.cpp */,
     1092                                14F252600D08DF2F004ECFFF /* JSVariableObject.cpp */,
    10781093                        );
    10791094                        path = kjs;
     
    13081323                                1480DB9D0DDC227F003CFDF2 /* DebuggerCallFrame.h in Headers */,
    13091324                                E18E3A580DF9278C00D90B34 /* JSGlobalData.h in Headers */,
     1325                                BC7952090E15E8A800A898AB /* ArrayConstructor.h in Headers */,
    13101326                        );
    13111327                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/JavaScriptCore/JavaScriptCoreSources.bkl

    r34582 r34843  
    4545        DerivedSources/JavaScriptCore/grammar.cpp
    4646        kjs/JSArray.cpp
     47        kjs/ArrayConstructor.cpp
    4748        kjs/ArrayPrototype.cpp
     49        kjs/BooleanConstructor.cpp
    4850        kjs/BooleanObject.cpp
     51        kjs/BooleanPrototype.cpp
    4952        kjs/collector.cpp
    5053        kjs/CommonIdentifiers.cpp
  • trunk/JavaScriptCore/VM/Machine.cpp

    r34842 r34843  
    4141#include "Profiler.h"
    4242#include "Register.h"
    43 #include "ArrayPrototype.h"
     43#include "JSArray.h"
    4444#include "debugger.h"
    4545#include "JSFunction.h"
    4646#include "JSString.h"
    4747#include "object_object.h"
    48 #include "operations.h"
    4948#include "operations.h"
    5049#include "RegExpObject.h"
  • trunk/JavaScriptCore/kjs/AllInOneFile.cpp

    r34659 r34843  
    3030#include "debugger.cpp"
    3131#include "JSArray.cpp"
     32#include "ArrayConstructor.cpp"
    3233#include "ArrayPrototype.cpp"
     34#include "BooleanConstructor.cpp"
    3335#include "BooleanObject.cpp"
     36#include "BooleanPrototype.cpp"
    3437#include "collector.cpp"
    3538#if PLATFORM(DARWIN)
  • trunk/JavaScriptCore/kjs/ArrayConstructor.cpp

    r34842 r34843  
    2323
    2424#include "config.h"
     25#include "ArrayConstructor.h"
     26
    2527#include "ArrayPrototype.h"
    26 
    27 #include "Machine.h"
     28#include "JSArray.h"
    2829#include "error_object.h"
    2930#include "lookup.h"
    30 #include "operations.h"
    31 #include <stdio.h>
    32 #include <wtf/Assertions.h>
    33 #include <wtf/HashSet.h>
    34 
    35 #include <algorithm> // for std::min
    3631
    3732namespace KJS {
    38 
    39 static JSValue* arrayProtoFuncToString(ExecState*, JSObject*, JSValue*, const ArgList&);
    40 static JSValue* arrayProtoFuncToLocaleString(ExecState*, JSObject*, JSValue*, const ArgList&);
    41 static JSValue* arrayProtoFuncConcat(ExecState*, JSObject*, JSValue*, const ArgList&);
    42 static JSValue* arrayProtoFuncJoin(ExecState*, JSObject*, JSValue*, const ArgList&);
    43 static JSValue* arrayProtoFuncPop(ExecState*, JSObject*, JSValue*, const ArgList&);
    44 static JSValue* arrayProtoFuncPush(ExecState*, JSObject*, JSValue*, const ArgList&);
    45 static JSValue* arrayProtoFuncReverse(ExecState*, JSObject*, JSValue*, const ArgList&);
    46 static JSValue* arrayProtoFuncShift(ExecState*, JSObject*, JSValue*, const ArgList&);
    47 static JSValue* arrayProtoFuncSlice(ExecState*, JSObject*, JSValue*, const ArgList&);
    48 static JSValue* arrayProtoFuncSort(ExecState*, JSObject*, JSValue*, const ArgList&);
    49 static JSValue* arrayProtoFuncSplice(ExecState*, JSObject*, JSValue*, const ArgList&);
    50 static JSValue* arrayProtoFuncUnShift(ExecState*, JSObject*, JSValue*, const ArgList&);
    51 static JSValue* arrayProtoFuncEvery(ExecState*, JSObject*, JSValue*, const ArgList&);
    52 static JSValue* arrayProtoFuncForEach(ExecState*, JSObject*, JSValue*, const ArgList&);
    53 static JSValue* arrayProtoFuncSome(ExecState*, JSObject*, JSValue*, const ArgList&);
    54 static JSValue* arrayProtoFuncIndexOf(ExecState*, JSObject*, JSValue*, const ArgList&);
    55 static JSValue* arrayProtoFuncFilter(ExecState*, JSObject*, JSValue*, const ArgList&);
    56 static JSValue* arrayProtoFuncMap(ExecState*, JSObject*, JSValue*, const ArgList&);
    57 static JSValue* arrayProtoFuncLastIndexOf(ExecState*, JSObject*, JSValue*, const ArgList&);
    58 
    59 }
    60 
    61 #include "ArrayPrototype.lut.h"
    62 
    63 namespace KJS {
    64 
    65 // ------------------------------ ArrayPrototype ----------------------------
    66 
    67 const ClassInfo ArrayPrototype::info = {"Array", &JSArray::info, 0, ExecState::arrayTable};
    68 
    69 /* Source for ArrayPrototype.lut.h
    70 @begin arrayTable 16
    71   toString       arrayProtoFuncToString       DontEnum|Function 0
    72   toLocaleString arrayProtoFuncToLocaleString DontEnum|Function 0
    73   concat         arrayProtoFuncConcat         DontEnum|Function 1
    74   join           arrayProtoFuncJoin           DontEnum|Function 1
    75   pop            arrayProtoFuncPop            DontEnum|Function 0
    76   push           arrayProtoFuncPush           DontEnum|Function 1
    77   reverse        arrayProtoFuncReverse        DontEnum|Function 0
    78   shift          arrayProtoFuncShift          DontEnum|Function 0
    79   slice          arrayProtoFuncSlice          DontEnum|Function 2
    80   sort           arrayProtoFuncSort           DontEnum|Function 1
    81   splice         arrayProtoFuncSplice         DontEnum|Function 2
    82   unshift        arrayProtoFuncUnShift        DontEnum|Function 1
    83   every          arrayProtoFuncEvery          DontEnum|Function 1
    84   forEach        arrayProtoFuncForEach        DontEnum|Function 1
    85   some           arrayProtoFuncSome           DontEnum|Function 1
    86   indexOf        arrayProtoFuncIndexOf        DontEnum|Function 1
    87   lastIndexOf    arrayProtoFuncLastIndexOf    DontEnum|Function 1
    88   filter         arrayProtoFuncFilter         DontEnum|Function 1
    89   map            arrayProtoFuncMap            DontEnum|Function 1
    90 @end
    91 */
    92 
    93 // ECMA 15.4.4
    94 ArrayPrototype::ArrayPrototype(ExecState*, ObjectPrototype* objProto)
    95     : JSArray(objProto, 0)
    96 {
    97 }
    98 
    99 bool ArrayPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    100 {
    101     return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayTable(exec), this, propertyName, slot);
    102 }
    103 
    104 
    105 // ------------------------------ Array Functions ----------------------------
    106 
    107 // Helper function
    108 static JSValue* getProperty(ExecState* exec, JSObject* obj, unsigned index)
    109 {
    110     PropertySlot slot(obj);
    111     if (!obj->getPropertySlot(exec, index, slot))
    112         return 0;
    113     return slot.getValue(exec, index);
    114 }
    115 
    116 JSValue* arrayProtoFuncToString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
    117 {
    118     if (!thisValue->isObject(&JSArray::info))
    119         return throwError(exec, TypeError);
    120     JSObject* thisObj = static_cast<JSArray*>(thisValue);
    121 
    122     HashSet<JSObject*>& arrayVisitedElements = exec->dynamicGlobalObject()->arrayVisitedElements();
    123     if (arrayVisitedElements.size() > MaxReentryDepth)
    124         return throwError(exec, RangeError, "Maximum call stack size exceeded.");
    125 
    126     bool alreadyVisited = !arrayVisitedElements.add(thisObj).second;
    127     Vector<UChar, 256> strBuffer;
    128     if (alreadyVisited)
    129         return jsString(exec, UString(0, 0)); // return an empty string, avoding infinite recursion.
    130 
    131     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    132     for (unsigned k = 0; k < length; k++) {
    133         if (k >= 1)
    134             strBuffer.append(',');
    135         if (!strBuffer.data()) {
    136             JSObject* error = Error::create(exec, GeneralError, "Out of memory");
    137             exec->setException(error);
    138             break;
    139         }
    140 
    141         JSValue* element = thisObj->get(exec, k);
    142         if (element->isUndefinedOrNull())
    143             continue;
    144 
    145         UString str = element->toString(exec);
    146         strBuffer.append(str.data(), str.size());
    147 
    148         if (!strBuffer.data()) {
    149             JSObject* error = Error::create(exec, GeneralError, "Out of memory");
    150             exec->setException(error);
    151         }
    152 
    153         if (exec->hadException())
    154             break;
    155     }
    156     exec->dynamicGlobalObject()->arrayVisitedElements().remove(thisObj);
    157     return jsString(exec, UString(strBuffer.data(), strBuffer.data() ? strBuffer.size() : 0));
    158 }
    159 
    160 JSValue* arrayProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
    161 {
    162     if (!thisValue->isObject(&JSArray::info))
    163         return throwError(exec, TypeError);
    164     JSObject* thisObj = static_cast<JSArray*>(thisValue);
    165 
    166     HashSet<JSObject*>& arrayVisitedElements = exec->dynamicGlobalObject()->arrayVisitedElements();
    167     if (arrayVisitedElements.size() > MaxReentryDepth)
    168         return throwError(exec, RangeError, "Maximum call stack size exceeded.");
    169 
    170     bool alreadyVisited = !arrayVisitedElements.add(thisObj).second;
    171     Vector<UChar, 256> strBuffer;
    172     if (alreadyVisited)
    173         return jsString(exec, UString(0, 0)); // return an empty string, avoding infinite recursion.
    174 
    175     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    176     for (unsigned k = 0; k < length; k++) {
    177         if (k >= 1)
    178             strBuffer.append(',');
    179         if (!strBuffer.data()) {
    180             JSObject* error = Error::create(exec, GeneralError, "Out of memory");
    181             exec->setException(error);
    182             break;
    183         }
    184 
    185         JSValue* element = thisObj->get(exec, k);
    186         if (element->isUndefinedOrNull())
    187             continue;
    188 
    189         JSObject* o = element->toObject(exec);
    190         JSValue* conversionFunction = o->get(exec, exec->propertyNames().toLocaleString);
    191         UString str;
    192         CallData callData;
    193         CallType callType = conversionFunction->getCallData(callData);
    194         if (callType != CallTypeNone)
    195             str = call(exec, conversionFunction, callType, callData, element, exec->emptyList())->toString(exec);
    196         else
    197             str = element->toString(exec);
    198         strBuffer.append(str.data(), str.size());
    199 
    200         if (!strBuffer.data()) {
    201             JSObject* error = Error::create(exec, GeneralError, "Out of memory");
    202             exec->setException(error);
    203         }
    204 
    205         if (exec->hadException())
    206             break;
    207     }
    208     exec->dynamicGlobalObject()->arrayVisitedElements().remove(thisObj);
    209     return jsString(exec, UString(strBuffer.data(), strBuffer.data() ? strBuffer.size() : 0));
    210 }
    211 
    212 JSValue* arrayProtoFuncJoin(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    213 {
    214     JSObject* thisObj = thisValue->toThisObject(exec);
    215 
    216     HashSet<JSObject*>& arrayVisitedElements = exec->dynamicGlobalObject()->arrayVisitedElements();
    217     if (arrayVisitedElements.size() > MaxReentryDepth)
    218         return throwError(exec, RangeError, "Maximum call stack size exceeded.");
    219 
    220     bool alreadyVisited = !arrayVisitedElements.add(thisObj).second;
    221     Vector<UChar, 256> strBuffer;
    222     if (alreadyVisited)
    223         return jsString(exec, UString(0, 0)); // return an empty string, avoding infinite recursion.
    224 
    225     UChar comma = ',';
    226     UString separator = args[0]->isUndefined() ? UString(&comma, 1) : args[0]->toString(exec);
    227 
    228     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    229     for (unsigned k = 0; k < length; k++) {
    230         if (k >= 1)
    231             strBuffer.append(separator.data(), separator.size());
    232         if (!strBuffer.data()) {
    233             JSObject* error = Error::create(exec, GeneralError, "Out of memory");
    234             exec->setException(error);
    235             break;
    236         }
    237 
    238         JSValue* element = thisObj->get(exec, k);
    239         if (element->isUndefinedOrNull())
    240             continue;
    241 
    242         UString str = element->toString(exec);
    243         strBuffer.append(str.data(), str.size());
    244 
    245         if (!strBuffer.data()) {
    246             JSObject* error = Error::create(exec, GeneralError, "Out of memory");
    247             exec->setException(error);
    248         }
    249 
    250         if (exec->hadException())
    251             break;
    252     }
    253     exec->dynamicGlobalObject()->arrayVisitedElements().remove(thisObj);
    254     return jsString(exec, UString(strBuffer.data(), strBuffer.data() ? strBuffer.size() : 0));
    255 }
    256 
    257 JSValue* arrayProtoFuncConcat(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    258 {
    259     JSArray* arr = constructEmptyArray(exec);
    260     int n = 0;
    261     JSValue* curArg = thisValue->toThisObject(exec);
    262     ArgList::const_iterator it = args.begin();
    263     ArgList::const_iterator end = args.end();
    264     while (1) {
    265         if (curArg->isObject(&JSArray::info)) {
    266             JSArray* curArray = static_cast<JSArray*>(curArg);
    267             unsigned length = curArray->getLength();
    268             for (unsigned k = 0; k < length; ++k) {
    269                 if (JSValue* v = curArray->getItem(k))
    270                     arr->put(exec, n, v);
    271                 n++;
    272             }
    273         } else {
    274             arr->put(exec, n, curArg);
    275             n++;
    276         }
    277         if (it == end)
    278             break;
    279         curArg = *it;
    280         ++it;
    281     }
    282     arr->setLength(n);
    283     return arr;
    284 }
    285 
    286 JSValue* arrayProtoFuncPop(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
    287 {
    288     JSObject* thisObj = thisValue->toThisObject(exec);
    289     JSValue* result = 0;
    290     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    291     if (length == 0) {
    292         thisObj->put(exec, exec->propertyNames().length, jsNumber(exec, length));
    293         result = jsUndefined();
    294     } else {
    295         result = thisObj->get(exec, length - 1);
    296         thisObj->deleteProperty(exec, length - 1);
    297         thisObj->put(exec, exec->propertyNames().length, jsNumber(exec, length - 1));
    298     }
    299     return result;
    300 }
    301 
    302 JSValue* arrayProtoFuncPush(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    303 {
    304     JSObject* thisObj = thisValue->toThisObject(exec);
    305     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    306     for (unsigned n = 0; n < args.size(); n++)
    307         thisObj->put(exec, length + n, args[n]);
    308     length += args.size();
    309     thisObj->put(exec, exec->propertyNames().length, jsNumber(exec, length));
    310     return jsNumber(exec, length);
    311 }
    312 
    313 JSValue* arrayProtoFuncReverse(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
    314 {
    315     JSObject* thisObj = thisValue->toThisObject(exec);
    316     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    317     unsigned middle = length / 2;
    318 
    319     for (unsigned k = 0; k < middle; k++) {
    320         unsigned lk1 = length - k - 1;
    321         JSValue* obj2 = getProperty(exec, thisObj, lk1);
    322         JSValue* obj = getProperty(exec, thisObj, k);
    323 
    324         if (obj2)
    325             thisObj->put(exec, k, obj2);
    326         else
    327             thisObj->deleteProperty(exec, k);
    328 
    329         if (obj)
    330             thisObj->put(exec, lk1, obj);
    331         else
    332             thisObj->deleteProperty(exec, lk1);
    333     }
    334     return thisObj;
    335 }
    336 
    337 JSValue* arrayProtoFuncShift(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
    338 {
    339     JSObject* thisObj = thisValue->toThisObject(exec);
    340     JSValue* result = 0;
    341 
    342     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    343     if (length == 0) {
    344         thisObj->put(exec, exec->propertyNames().length, jsNumber(exec, length));
    345         result = jsUndefined();
    346     } else {
    347         result = thisObj->get(exec, 0);
    348         for (unsigned k = 1; k < length; k++) {
    349             if (JSValue* obj = getProperty(exec, thisObj, k))
    350                 thisObj->put(exec, k - 1, obj);
    351             else
    352                 thisObj->deleteProperty(exec, k - 1);
    353         }
    354         thisObj->deleteProperty(exec, length - 1);
    355         thisObj->put(exec, exec->propertyNames().length, jsNumber(exec, length - 1));
    356     }
    357     return result;
    358 }
    359 
    360 JSValue* arrayProtoFuncSlice(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    361 {
    362     // http://developer.netscape.com/docs/manuals/js/client/jsref/array.htm#1193713 or 15.4.4.10
    363 
    364     JSObject* thisObj = thisValue->toThisObject(exec);
    365 
    366     // We return a new array
    367     JSArray* resObj = constructEmptyArray(exec);
    368     JSValue* result = resObj;
    369     double begin = args[0]->toInteger(exec);
    370     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    371     if (begin >= 0) {
    372         if (begin > length)
    373             begin = length;
    374     } else {
    375         begin += length;
    376         if (begin < 0)
    377             begin = 0;
    378     }
    379     double end;
    380     if (args[1]->isUndefined())
    381         end = length;
    382     else {
    383         end = args[1]->toInteger(exec);
    384         if (end < 0) {
    385             end += length;
    386             if (end < 0)
    387                 end = 0;
    388         } else {
    389             if (end > length)
    390                 end = length;
    391         }
    392     }
    393 
    394     int n = 0;
    395     int b = static_cast<int>(begin);
    396     int e = static_cast<int>(end);
    397     for (int k = b; k < e; k++, n++) {
    398         if (JSValue* v = getProperty(exec, thisObj, k))
    399             resObj->put(exec, n, v);
    400     }
    401     resObj->setLength(n);
    402     return result;
    403 }
    404 
    405 JSValue* arrayProtoFuncSort(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    406 {
    407     JSObject* thisObj = thisValue->toThisObject(exec);
    408 
    409     JSValue* function = args[0];
    410     CallData callData;
    411     CallType callType = function->getCallData(callData);
    412 
    413     if (thisObj->classInfo() == &JSArray::info) {
    414         if (callType != CallTypeNone)
    415             static_cast<JSArray*>(thisObj)->sort(exec, function, callType, callData);
    416         else
    417             static_cast<JSArray*>(thisObj)->sort(exec);
    418         return thisObj;
    419     }
    420 
    421     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    422 
    423     if (!length)
    424         return thisObj;
    425 
    426     // "Min" sort. Not the fastest, but definitely less code than heapsort
    427     // or quicksort, and much less swapping than bubblesort/insertionsort.
    428     for (unsigned i = 0; i < length - 1; ++i) {
    429         JSValue* iObj = thisObj->get(exec, i);
    430         unsigned themin = i;
    431         JSValue* minObj = iObj;
    432         for (unsigned j = i + 1; j < length; ++j) {
    433             JSValue* jObj = thisObj->get(exec, j);
    434             double compareResult;
    435             if (jObj->isUndefined())
    436                 compareResult = 1; // don't check minObj because there's no need to differentiate == (0) from > (1)
    437             else if (minObj->isUndefined())
    438                 compareResult = -1;
    439             else if (callType != CallTypeNone) {
    440                 ArgList l;
    441                 l.append(jObj);
    442                 l.append(minObj);
    443                 compareResult = call(exec, function, callType, callData, exec->globalThisValue(), l)->toNumber(exec);
    444             } else
    445                 compareResult = (jObj->toString(exec) < minObj->toString(exec)) ? -1 : 1;
    446 
    447             if (compareResult < 0) {
    448                 themin = j;
    449                 minObj = jObj;
    450             }
    451         }
    452         // Swap themin and i
    453         if (themin > i) {
    454             thisObj->put(exec, i, minObj);
    455             thisObj->put(exec, themin, iObj);
    456         }
    457     }
    458     return thisObj;
    459 }
    460 
    461 JSValue* arrayProtoFuncSplice(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    462 {
    463     JSObject* thisObj = thisValue->toThisObject(exec);
    464 
    465     // 15.4.4.12
    466     JSArray* resObj = constructEmptyArray(exec);
    467     JSValue* result = resObj;
    468     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    469     if (!args.size())
    470         return jsUndefined();
    471     int begin = args[0]->toUInt32(exec);
    472     if (begin < 0)
    473         begin = std::max<int>(begin + length, 0);
    474     else
    475         begin = std::min<int>(begin, length);
    476 
    477     unsigned deleteCount;
    478     if (args.size() > 1)
    479         deleteCount = std::min<int>(std::max<int>(args[1]->toUInt32(exec), 0), length - begin);
    480     else
    481         deleteCount = length - begin;
    482 
    483     for (unsigned k = 0; k < deleteCount; k++) {
    484         if (JSValue* v = getProperty(exec, thisObj, k + begin))
    485             resObj->put(exec, k, v);
    486     }
    487     resObj->setLength(deleteCount);
    488 
    489     unsigned additionalArgs = std::max<int>(args.size() - 2, 0);
    490     if (additionalArgs != deleteCount) {
    491         if (additionalArgs < deleteCount) {
    492             for (unsigned k = begin; k < length - deleteCount; ++k) {
    493                 if (JSValue* v = getProperty(exec, thisObj, k + deleteCount))
    494                     thisObj->put(exec, k + additionalArgs, v);
    495                 else
    496                     thisObj->deleteProperty(exec, k + additionalArgs);
    497             }
    498             for (unsigned k = length; k > length - deleteCount + additionalArgs; --k)
    499                 thisObj->deleteProperty(exec, k - 1);
    500         } else {
    501             for (unsigned k = length - deleteCount; (int)k > begin; --k) {
    502                 if (JSValue* obj = getProperty(exec, thisObj, k + deleteCount - 1))
    503                     thisObj->put(exec, k + additionalArgs - 1, obj);
    504                 else
    505                     thisObj->deleteProperty(exec, k + additionalArgs - 1);
    506             }
    507         }
    508     }
    509     for (unsigned k = 0; k < additionalArgs; ++k)
    510         thisObj->put(exec, k + begin, args[k + 2]);
    511 
    512     thisObj->put(exec, exec->propertyNames().length, jsNumber(exec, length - deleteCount + additionalArgs));
    513     return result;
    514 }
    515 
    516 JSValue* arrayProtoFuncUnShift(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    517 {
    518     JSObject* thisObj = thisValue->toThisObject(exec);
    519 
    520     // 15.4.4.13
    521     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    522     unsigned nrArgs = args.size();
    523     if (nrArgs) {
    524         for (unsigned k = length; k > 0; --k) {
    525             if (JSValue* v = getProperty(exec, thisObj, k - 1))
    526                 thisObj->put(exec, k + nrArgs - 1, v);
    527             else
    528                 thisObj->deleteProperty(exec, k + nrArgs - 1);
    529         }
    530     }
    531     for (unsigned k = 0; k < nrArgs; ++k)
    532         thisObj->put(exec, k, args[k]);
    533     JSValue* result = jsNumber(exec, length + nrArgs);
    534     thisObj->put(exec, exec->propertyNames().length, result);
    535     return result;
    536 }
    537 
    538 JSValue* arrayProtoFuncFilter(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    539 {
    540     JSObject* thisObj = thisValue->toThisObject(exec);
    541 
    542     JSValue* function = args[0];
    543     CallData callData;
    544     CallType callType = function->getCallData(callData);
    545     if (callType == CallTypeNone)
    546         return throwError(exec, TypeError);
    547 
    548     JSObject* applyThis = args[1]->isUndefinedOrNull() ? exec->globalThisValue() : args[1]->toObject(exec);
    549     JSArray* resultArray = constructEmptyArray(exec);
    550 
    551     unsigned filterIndex = 0;
    552     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    553     for (unsigned k = 0; k < length && !exec->hadException(); ++k) {
    554         PropertySlot slot(thisObj);
    555 
    556         if (!thisObj->getPropertySlot(exec, k, slot))
    557             continue;
    558 
    559         JSValue* v = slot.getValue(exec, k);
    560 
    561         ArgList eachArguments;
    562 
    563         eachArguments.append(v);
    564         eachArguments.append(jsNumber(exec, k));
    565         eachArguments.append(thisObj);
    566 
    567         JSValue* result = call(exec, function, callType, callData, applyThis, eachArguments);
    568 
    569         if (result->toBoolean(exec))
    570             resultArray->put(exec, filterIndex++, v);
    571     }
    572     return resultArray;
    573 }
    574 
    575 JSValue* arrayProtoFuncMap(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    576 {
    577     JSObject* thisObj = thisValue->toThisObject(exec);
    578 
    579     JSValue* function = args[0];
    580     CallData callData;
    581     CallType callType = function->getCallData(callData);
    582     if (callType == CallTypeNone)
    583         return throwError(exec, TypeError);
    584 
    585     JSObject* applyThis = args[1]->isUndefinedOrNull() ? exec->globalThisValue() : args[1]->toObject(exec);
    586 
    587     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    588 
    589     JSArray* resultArray = constructEmptyArray(exec, length);
    590 
    591     for (unsigned k = 0; k < length && !exec->hadException(); ++k) {
    592         PropertySlot slot(thisObj);
    593         if (!thisObj->getPropertySlot(exec, k, slot))
    594             continue;
    595 
    596         JSValue* v = slot.getValue(exec, k);
    597 
    598         ArgList eachArguments;
    599 
    600         eachArguments.append(v);
    601         eachArguments.append(jsNumber(exec, k));
    602         eachArguments.append(thisObj);
    603 
    604         JSValue* result = call(exec, function, callType, callData, applyThis, eachArguments);
    605         resultArray->put(exec, k, result);
    606     }
    607 
    608     return resultArray;
    609 }
    610 
    611 // Documentation for these three is available at:
    612 // http://developer-test.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:every
    613 // http://developer-test.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:forEach
    614 // http://developer-test.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:some
    615 
    616 JSValue* arrayProtoFuncEvery(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    617 {
    618     JSObject* thisObj = thisValue->toThisObject(exec);
    619 
    620     JSValue* function = args[0];
    621     CallData callData;
    622     CallType callType = function->getCallData(callData);
    623     if (callType == CallTypeNone)
    624         return throwError(exec, TypeError);
    625 
    626     JSObject* applyThis = args[1]->isUndefinedOrNull() ? exec->globalThisValue() : args[1]->toObject(exec);
    627 
    628     JSValue* result = jsBoolean(true);
    629 
    630     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    631     for (unsigned k = 0; k < length && !exec->hadException(); ++k) {
    632         PropertySlot slot(thisObj);
    633 
    634         if (!thisObj->getPropertySlot(exec, k, slot))
    635             continue;
    636 
    637         ArgList eachArguments;
    638 
    639         eachArguments.append(slot.getValue(exec, k));
    640         eachArguments.append(jsNumber(exec, k));
    641         eachArguments.append(thisObj);
    642 
    643         bool predicateResult = call(exec, function, callType, callData, applyThis, eachArguments)->toBoolean(exec);
    644 
    645         if (!predicateResult) {
    646             result = jsBoolean(false);
    647             break;
    648         }
    649     }
    650 
    651     return result;
    652 }
    653 
    654 JSValue* arrayProtoFuncForEach(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    655 {
    656     JSObject* thisObj = thisValue->toThisObject(exec);
    657 
    658     JSValue* function = args[0];
    659     CallData callData;
    660     CallType callType = function->getCallData(callData);
    661     if (callType == CallTypeNone)
    662         return throwError(exec, TypeError);
    663 
    664     JSObject* applyThis = args[1]->isUndefinedOrNull() ? exec->globalThisValue() : args[1]->toObject(exec);
    665 
    666     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    667     for (unsigned k = 0; k < length && !exec->hadException(); ++k) {
    668         PropertySlot slot(thisObj);
    669         if (!thisObj->getPropertySlot(exec, k, slot))
    670             continue;
    671 
    672         ArgList eachArguments;
    673         eachArguments.append(slot.getValue(exec, k));
    674         eachArguments.append(jsNumber(exec, k));
    675         eachArguments.append(thisObj);
    676 
    677         call(exec, function, callType, callData, applyThis, eachArguments);
    678     }
    679     return jsUndefined();
    680 }
    681 
    682 JSValue* arrayProtoFuncSome(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    683 {
    684     JSObject* thisObj = thisValue->toThisObject(exec);
    685 
    686     JSValue* function = args[0];
    687     CallData callData;
    688     CallType callType = function->getCallData(callData);
    689     if (callType == CallTypeNone)
    690         return throwError(exec, TypeError);
    691 
    692     JSObject* applyThis = args[1]->isUndefinedOrNull() ? exec->globalThisValue() : args[1]->toObject(exec);
    693 
    694     JSValue* result = jsBoolean(false);
    695 
    696     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    697     for (unsigned k = 0; k < length && !exec->hadException(); ++k) {
    698         PropertySlot slot(thisObj);
    699         if (!thisObj->getPropertySlot(exec, k, slot))
    700             continue;
    701 
    702         ArgList eachArguments;
    703         eachArguments.append(slot.getValue(exec, k));
    704         eachArguments.append(jsNumber(exec, k));
    705         eachArguments.append(thisObj);
    706 
    707         bool predicateResult = call(exec, function, callType, callData, applyThis, eachArguments)->toBoolean(exec);
    708 
    709         if (predicateResult) {
    710             result = jsBoolean(true);
    711             break;
    712         }
    713     }
    714     return result;
    715 }
    716 
    717 JSValue* arrayProtoFuncIndexOf(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    718 {
    719     // JavaScript 1.5 Extension by Mozilla
    720     // Documentation: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:indexOf
    721 
    722     JSObject* thisObj = thisValue->toThisObject(exec);
    723 
    724     unsigned index = 0;
    725     double d = args[1]->toInteger(exec);
    726     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    727     if (d < 0)
    728         d += length;
    729     if (d > 0) {
    730         if (d > length)
    731             index = length;
    732         else
    733             index = static_cast<unsigned>(d);
    734     }
    735 
    736     JSValue* searchElement = args[0];
    737     for (; index < length; ++index) {
    738         JSValue* e = getProperty(exec, thisObj, index);
    739         if (!e)
    740             continue;
    741         if (strictEqual(searchElement, e))
    742             return jsNumber(exec, index);
    743     }
    744 
    745     return jsNumber(exec, -1);
    746 }
    747 
    748 JSValue* arrayProtoFuncLastIndexOf(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
    749 {
    750     // JavaScript 1.6 Extension by Mozilla
    751     // Documentation: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:lastIndexOf
    752 
    753     JSObject* thisObj = thisValue->toThisObject(exec);
    754 
    755     unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
    756     int index = length - 1;
    757     double d = args[1]->toIntegerPreserveNaN(exec);
    758 
    759     if (d < 0) {
    760         d += length;
    761         if (d < 0)
    762             return jsNumber(exec, -1);
    763     }
    764     if (d < length)
    765         index = static_cast<int>(d);
    766 
    767     JSValue* searchElement = args[0];
    768     for (; index >= 0; --index) {
    769         JSValue* e = getProperty(exec, thisObj, index);
    770         if (!e)
    771             continue;
    772         if (strictEqual(searchElement, e))
    773             return jsNumber(exec, index);
    774     }
    775 
    776     return jsNumber(exec, -1);
    777 }
    778 
    779 // ------------------------------ ArrayConstructor -------------------------------
    78033
    78134ArrayConstructor::ArrayConstructor(ExecState* exec, FunctionPrototype* funcProto, ArrayPrototype* arrayProto)
  • trunk/JavaScriptCore/kjs/ArrayConstructor.h

    r34842 r34843  
    1919 */
    2020
    21 #ifndef ArrayPrototype_h
    22 #define ArrayPrototype_h
     21#ifndef ArrayConstructor_h
     22#define ArrayConstructor_h
    2323
    24 #include "JSArray.h"
    2524#include "FunctionPrototype.h"
    26 #include "lookup.h"
    2725
    2826namespace KJS {
    2927
    30  class ArrayPrototype : public JSArray {
    31   public:
    32     ArrayPrototype(ExecState*, ObjectPrototype*);
    33 
    34     bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    35     virtual const ClassInfo* classInfo() const { return &info; }
    36     static const ClassInfo info;
    37   };
     28  class ArrayPrototype;
    3829
    3930  class ArrayConstructor : public InternalFunction {
     
    4637} // namespace KJS
    4738
    48 #endif // ArrayPrototype_h
     39#endif // ArrayConstructor_h
  • trunk/JavaScriptCore/kjs/ArrayPrototype.cpp

    r34754 r34843  
    2929#include "lookup.h"
    3030#include "operations.h"
    31 #include <stdio.h>
    3231#include <wtf/Assertions.h>
    3332#include <wtf/HashSet.h>
     
    777776}
    778777
    779 // ------------------------------ ArrayConstructor -------------------------------
    780 
    781 ArrayConstructor::ArrayConstructor(ExecState* exec, FunctionPrototype* funcProto, ArrayPrototype* arrayProto)
    782     : InternalFunction(funcProto, Identifier(exec, arrayProto->classInfo()->className))
    783 {
    784     // ECMA 15.4.3.1 Array.prototype
    785     putDirect(exec->propertyNames().prototype, arrayProto, DontEnum|DontDelete|ReadOnly);
    786 
    787     // no. of arguments for constructor
    788     putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontEnum | DontDelete);
    789 }
    790 
    791 static JSObject* constructArrayWithSizeQuirk(ExecState* exec, const ArgList& args)
    792 {
    793     // a single numeric argument denotes the array size (!)
    794     if (args.size() == 1 && args[0]->isNumber()) {
    795         uint32_t n = args[0]->toUInt32(exec);
    796         if (n != args[0]->toNumber(exec))
    797             return throwError(exec, RangeError, "Array size is not a small enough positive integer.");
    798         return new (exec) JSArray(exec->lexicalGlobalObject()->arrayPrototype(), n);
    799     }
    800 
    801     // otherwise the array is constructed with the arguments in it
    802     return new (exec) JSArray(exec->lexicalGlobalObject()->arrayPrototype(), args);
    803 }
    804 
    805 static JSObject* constructWithArrayConstructor(ExecState* exec, JSObject*, const ArgList& args)
    806 {
    807     return constructArrayWithSizeQuirk(exec, args);
    808 }
    809 
    810 // ECMA 15.4.2
    811 ConstructType ArrayConstructor::getConstructData(ConstructData& constructData)
    812 {
    813     constructData.native.function = constructWithArrayConstructor;
    814     return ConstructTypeNative;
    815 }
    816 
    817 static JSValue* callArrayConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
    818 {
    819     return constructArrayWithSizeQuirk(exec, args);
    820 }
    821 
    822 // ECMA 15.6.1
    823 CallType ArrayConstructor::getCallData(CallData& callData)
    824 {
    825     // equivalent to 'new Array(....)'
    826     callData.native.function = callArrayConstructor;
    827     return CallTypeNative;
    828 }
    829 
    830 }
     778}
  • trunk/JavaScriptCore/kjs/ArrayPrototype.h

    r34754 r34843  
    2323
    2424#include "JSArray.h"
    25 #include "FunctionPrototype.h"
    2625#include "lookup.h"
    2726
     
    3736  };
    3837
    39   class ArrayConstructor : public InternalFunction {
    40   public:
    41     ArrayConstructor(ExecState*, FunctionPrototype*, ArrayPrototype*);
    42     virtual ConstructType getConstructData(ConstructData&);
    43     virtual CallType getCallData(CallData&);
    44   };
    45 
    4638} // namespace KJS
    4739
  • trunk/JavaScriptCore/kjs/BooleanConstructor.cpp

    r34842 r34843  
    2020
    2121#include "config.h"
    22 #include "BooleanObject.h"
     22#include "BooleanConstructor.h"
    2323
     24#include "BooleanPrototype.h"
    2425#include "JSGlobalObject.h"
    25 #include "error_object.h"
    26 #include "operations.h"
    27 #include <wtf/Assertions.h>
    2826
    2927namespace KJS {
    30 
    31 // ------------------------------ BooleanObject ---------------------------
    32 
    33 const ClassInfo BooleanObject::info = { "Boolean", 0, 0, 0 };
    34 
    35 BooleanObject::BooleanObject(JSObject* proto)
    36     : JSWrapperObject(proto)
    37 {
    38 }
    39 
    40 // ------------------------------ BooleanPrototype --------------------------
    41 
    42 // Functions
    43 static JSValue* booleanProtoFuncToString(ExecState*, JSObject*, JSValue*, const ArgList&);
    44 static JSValue* booleanProtoFuncValueOf(ExecState*, JSObject*, JSValue*, const ArgList&);
    45 
    46 // ECMA 15.6.4
    47 
    48 BooleanPrototype::BooleanPrototype(ExecState* exec, ObjectPrototype* objectPrototype, FunctionPrototype* functionPrototype)
    49     : BooleanObject(objectPrototype)
    50 {
    51     setInternalValue(jsBoolean(false));
    52 
    53     putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().toString, booleanProtoFuncToString), DontEnum);
    54     putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().valueOf, booleanProtoFuncValueOf), DontEnum);
    55 }
    56 
    57 
    58 // ------------------------------ Functions --------------------------
    59 
    60 // ECMA 15.6.4.2 + 15.6.4.3
    61 
    62 JSValue* booleanProtoFuncToString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
    63 {
    64     if (thisValue == jsBoolean(false))
    65         return jsString(exec, "false");
    66 
    67     if (thisValue == jsBoolean(true))
    68         return jsString(exec, "true");
    69 
    70     if (!thisValue->isObject(&BooleanObject::info))
    71         return throwError(exec, TypeError);
    72 
    73     if (static_cast<BooleanObject*>(thisValue)->internalValue() == jsBoolean(false))
    74         return jsString(exec, "false");
    75 
    76     ASSERT(static_cast<BooleanObject*>(thisValue)->internalValue() == jsBoolean(true));
    77     return jsString(exec, "true");
    78 }
    79 
    80 JSValue* booleanProtoFuncValueOf(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
    81 {
    82     if (JSImmediate::isBoolean(thisValue))
    83         return thisValue;
    84 
    85     if (!thisValue->isObject(&BooleanObject::info))
    86         return throwError(exec, TypeError);
    87 
    88     return static_cast<BooleanObject*>(thisValue)->internalValue();
    89 }
    90 
    91 // ------------------------------ BooleanConstructor -----------------------------
    92 
    9328
    9429BooleanConstructor::BooleanConstructor(ExecState* exec, FunctionPrototype* functionPrototype, BooleanPrototype* booleanPrototype)
  • trunk/JavaScriptCore/kjs/BooleanConstructor.h

    r34842 r34843  
    1919 */
    2020
    21 #ifndef BooleanObject_h
    22 #define BooleanObject_h
     21#ifndef BooleanConstructor_h
     22#define BooleanConstructor_h
    2323
    2424#include "FunctionPrototype.h"
    25 #include "JSWrapperObject.h"
    2625
    2726namespace KJS {
    28 
    29     class BooleanObject : public JSWrapperObject {
    30     public:
    31         BooleanObject(JSObject* proto);
    32 
    33         virtual const ClassInfo* classInfo() const { return &info; }
    34         static const ClassInfo info;
    35     };
    36 
    37     /**
    38      * @internal
    39      *
    40      * The initial value of Boolean.prototype (and thus all objects created
    41      * with the Boolean constructor
    42      */
    43     class BooleanPrototype : public BooleanObject {
    44     public:
    45         BooleanPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*);
    46     };
    4727
    4828    /**
     
    6444} // namespace KJS
    6545
    66 #endif // BooleanObject_h
     46#endif // BooleanConstructor_h
  • trunk/JavaScriptCore/kjs/BooleanObject.cpp

    r34821 r34843  
    2222#include "BooleanObject.h"
    2323
    24 #include "JSGlobalObject.h"
    25 #include "error_object.h"
    26 #include "operations.h"
    27 #include <wtf/Assertions.h>
    28 
    2924namespace KJS {
    30 
    31 // ------------------------------ BooleanObject ---------------------------
    3225
    3326const ClassInfo BooleanObject::info = { "Boolean", 0, 0, 0 };
     
    3831}
    3932
    40 // ------------------------------ BooleanPrototype --------------------------
    41 
    42 // Functions
    43 static JSValue* booleanProtoFuncToString(ExecState*, JSObject*, JSValue*, const ArgList&);
    44 static JSValue* booleanProtoFuncValueOf(ExecState*, JSObject*, JSValue*, const ArgList&);
    45 
    46 // ECMA 15.6.4
    47 
    48 BooleanPrototype::BooleanPrototype(ExecState* exec, ObjectPrototype* objectPrototype, FunctionPrototype* functionPrototype)
    49     : BooleanObject(objectPrototype)
    50 {
    51     setInternalValue(jsBoolean(false));
    52 
    53     putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().toString, booleanProtoFuncToString), DontEnum);
    54     putDirectFunction(new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().valueOf, booleanProtoFuncValueOf), DontEnum);
    55 }
    56 
    57 
    58 // ------------------------------ Functions --------------------------
    59 
    60 // ECMA 15.6.4.2 + 15.6.4.3
    61 
    62 JSValue* booleanProtoFuncToString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
    63 {
    64     if (thisValue == jsBoolean(false))
    65         return jsString(exec, "false");
    66 
    67     if (thisValue == jsBoolean(true))
    68         return jsString(exec, "true");
    69 
    70     if (!thisValue->isObject(&BooleanObject::info))
    71         return throwError(exec, TypeError);
    72 
    73     if (static_cast<BooleanObject*>(thisValue)->internalValue() == jsBoolean(false))
    74         return jsString(exec, "false");
    75 
    76     ASSERT(static_cast<BooleanObject*>(thisValue)->internalValue() == jsBoolean(true));
    77     return jsString(exec, "true");
    78 }
    79 
    80 JSValue* booleanProtoFuncValueOf(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
    81 {
    82     if (JSImmediate::isBoolean(thisValue))
    83         return thisValue;
    84 
    85     if (!thisValue->isObject(&BooleanObject::info))
    86         return throwError(exec, TypeError);
    87 
    88     return static_cast<BooleanObject*>(thisValue)->internalValue();
    89 }
    90 
    91 // ------------------------------ BooleanConstructor -----------------------------
    92 
    93 
    94 BooleanConstructor::BooleanConstructor(ExecState* exec, FunctionPrototype* functionPrototype, BooleanPrototype* booleanPrototype)
    95     : InternalFunction(functionPrototype, Identifier(exec, booleanPrototype->classInfo()->className))
    96 {
    97     putDirect(exec->propertyNames().prototype, booleanPrototype, DontEnum | DontDelete | ReadOnly);
    98 
    99     // no. of arguments for constructor
    100     putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontDelete | DontEnum);
    101 }
    102 
    103 // ECMA 15.6.2
    104 JSObject* constructBoolean(ExecState* exec, const ArgList& args)
    105 {
    106     BooleanObject* obj = new (exec) BooleanObject(exec->lexicalGlobalObject()->booleanPrototype());
    107     obj->setInternalValue(jsBoolean(args[0]->toBoolean(exec)));
    108     return obj;
    109 }
    110 
    111 static JSObject* constructWithBooleanConstructor(ExecState* exec, JSObject*, const ArgList& args)
    112 {
    113     return constructBoolean(exec, args);
    114 }
    115 
    116 ConstructType BooleanConstructor::getConstructData(ConstructData& constructData)
    117 {
    118     constructData.native.function = constructWithBooleanConstructor;
    119     return ConstructTypeNative;
    120 }
    121 
    122 // ECMA 15.6.1
    123 static JSValue* callBooleanConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
    124 {
    125     return jsBoolean(args[0]->toBoolean(exec));
    126 }
    127 
    128 CallType BooleanConstructor::getCallData(CallData& callData)
    129 {
    130     callData.native.function = callBooleanConstructor;
    131     return CallTypeNative;
    132 }
    133 
    134 JSObject* constructBooleanFromImmediateBoolean(ExecState* exec, JSValue* immediateBooleanValue)
    135 {
    136     BooleanObject* obj = new (exec) BooleanObject(exec->lexicalGlobalObject()->booleanPrototype());
    137     obj->setInternalValue(immediateBooleanValue);
    138     return obj;
    139 }
    140 
    14133} // namespace KJS
  • trunk/JavaScriptCore/kjs/BooleanObject.h

    r34754 r34843  
    2222#define BooleanObject_h
    2323
    24 #include "FunctionPrototype.h"
    2524#include "JSWrapperObject.h"
    2625
     
    3534    };
    3635
    37     /**
    38      * @internal
    39      *
    40      * The initial value of Boolean.prototype (and thus all objects created
    41      * with the Boolean constructor
    42      */
    43     class BooleanPrototype : public BooleanObject {
    44     public:
    45         BooleanPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*);
    46     };
    47 
    48     /**
    49      * @internal
    50      *
    51      * The initial value of the the global variable's "Boolean" property
    52      */
    53     class BooleanConstructor : public InternalFunction {
    54     public:
    55         BooleanConstructor(ExecState*, FunctionPrototype*, BooleanPrototype*);
    56     private:
    57         virtual ConstructType getConstructData(ConstructData&);
    58         virtual CallType getCallData(CallData&);
    59     };
    60 
    61     JSObject* constructBooleanFromImmediateBoolean(ExecState*, JSValue*);
    62     JSObject* constructBoolean(ExecState*, const ArgList&);
    63 
    6436} // namespace KJS
    6537
  • trunk/JavaScriptCore/kjs/BooleanPrototype.cpp

    r34842 r34843  
    2020
    2121#include "config.h"
    22 #include "BooleanObject.h"
     22#include "BooleanPrototype.h"
    2323
    24 #include "JSGlobalObject.h"
    2524#include "error_object.h"
    26 #include "operations.h"
    27 #include <wtf/Assertions.h>
    2825
    2926namespace KJS {
    30 
    31 // ------------------------------ BooleanObject ---------------------------
    32 
    33 const ClassInfo BooleanObject::info = { "Boolean", 0, 0, 0 };
    34 
    35 BooleanObject::BooleanObject(JSObject* proto)
    36     : JSWrapperObject(proto)
    37 {
    38 }
    39 
    40 // ------------------------------ BooleanPrototype --------------------------
    4127
    4228// Functions
     
    8975}
    9076
    91 // ------------------------------ BooleanConstructor -----------------------------
    92 
    93 
    94 BooleanConstructor::BooleanConstructor(ExecState* exec, FunctionPrototype* functionPrototype, BooleanPrototype* booleanPrototype)
    95     : InternalFunction(functionPrototype, Identifier(exec, booleanPrototype->classInfo()->className))
    96 {
    97     putDirect(exec->propertyNames().prototype, booleanPrototype, DontEnum | DontDelete | ReadOnly);
    98 
    99     // no. of arguments for constructor
    100     putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontDelete | DontEnum);
    101 }
    102 
    103 // ECMA 15.6.2
    104 JSObject* constructBoolean(ExecState* exec, const ArgList& args)
    105 {
    106     BooleanObject* obj = new (exec) BooleanObject(exec->lexicalGlobalObject()->booleanPrototype());
    107     obj->setInternalValue(jsBoolean(args[0]->toBoolean(exec)));
    108     return obj;
    109 }
    110 
    111 static JSObject* constructWithBooleanConstructor(ExecState* exec, JSObject*, const ArgList& args)
    112 {
    113     return constructBoolean(exec, args);
    114 }
    115 
    116 ConstructType BooleanConstructor::getConstructData(ConstructData& constructData)
    117 {
    118     constructData.native.function = constructWithBooleanConstructor;
    119     return ConstructTypeNative;
    120 }
    121 
    122 // ECMA 15.6.1
    123 static JSValue* callBooleanConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
    124 {
    125     return jsBoolean(args[0]->toBoolean(exec));
    126 }
    127 
    128 CallType BooleanConstructor::getCallData(CallData& callData)
    129 {
    130     callData.native.function = callBooleanConstructor;
    131     return CallTypeNative;
    132 }
    133 
    134 JSObject* constructBooleanFromImmediateBoolean(ExecState* exec, JSValue* immediateBooleanValue)
    135 {
    136     BooleanObject* obj = new (exec) BooleanObject(exec->lexicalGlobalObject()->booleanPrototype());
    137     obj->setInternalValue(immediateBooleanValue);
    138     return obj;
    139 }
    140 
    14177} // namespace KJS
  • trunk/JavaScriptCore/kjs/BooleanPrototype.h

    r34842 r34843  
    1919 */
    2020
    21 #ifndef BooleanObject_h
    22 #define BooleanObject_h
     21#ifndef BooleanPrototype_h
     22#define BooleanPrototype_h
    2323
    24 #include "FunctionPrototype.h"
    25 #include "JSWrapperObject.h"
     24#include "BooleanObject.h"
    2625
    2726namespace KJS {
    28 
    29     class BooleanObject : public JSWrapperObject {
    30     public:
    31         BooleanObject(JSObject* proto);
    32 
    33         virtual const ClassInfo* classInfo() const { return &info; }
    34         static const ClassInfo info;
    35     };
    3627
    3728    /**
     
    4637    };
    4738
    48     /**
    49      * @internal
    50      *
    51      * The initial value of the the global variable's "Boolean" property
    52      */
    53     class BooleanConstructor : public InternalFunction {
    54     public:
    55         BooleanConstructor(ExecState*, FunctionPrototype*, BooleanPrototype*);
    56     private:
    57         virtual ConstructType getConstructData(ConstructData&);
    58         virtual CallType getCallData(CallData&);
    59     };
    60 
    61     JSObject* constructBooleanFromImmediateBoolean(ExecState*, JSValue*);
    62     JSObject* constructBoolean(ExecState*, const ArgList&);
    63 
    6439} // namespace KJS
    6540
    66 #endif // BooleanObject_h
     41#endif // BooleanPrototype_h
  • trunk/JavaScriptCore/kjs/CommonIdentifiers.h

    r34587 r34843  
    6969
    7070    class CommonIdentifiers : Noncopyable {
    71 
    7271    private:
    7372        CommonIdentifiers(JSGlobalData*);
  • trunk/JavaScriptCore/kjs/FunctionPrototype.cpp

    r34821 r34843  
    2424#include "JSGlobalObject.h"
    2525#include "Parser.h"
    26 #include "ArrayPrototype.h"
    2726#include "debugger.h"
    2827#include "JSFunction.h"
  • trunk/JavaScriptCore/kjs/JSArray.cpp

    r34809 r34843  
    2626#include "ArrayPrototype.h"
    2727#include "PropertyNameArray.h"
     28#include <wtf/AVLTree.h>
    2829#include <wtf/Assertions.h>
    29 #include <wtf/AVLTree.h>
    3030
    3131#define CHECK_ARRAY_CONSISTENCY 0
  • trunk/JavaScriptCore/kjs/JSGlobalObject.cpp

    r34842 r34843  
    3333#include "CodeBlock.h"
    3434#include "ArrayPrototype.h"
    35 #include "BooleanObject.h"
     35#include "ArrayConstructor.h"
     36#include "BooleanPrototype.h"
     37#include "BooleanConstructor.h"
    3638#include "date_object.h"
    3739#include "debugger.h"
  • trunk/JavaScriptCore/kjs/JSImmediate.cpp

    r34825 r34843  
    2222#include "JSImmediate.h"
    2323
    24 #include "BooleanObject.h"
     24#include "BooleanConstructor.h"
    2525#include "JSGlobalObject.h"
    2626#include "JSNotAnObject.h"
  • trunk/JavaScriptCore/kjs/Shell.cpp

    r34793 r34843  
    2424
    2525#include "CodeGenerator.h"
     26#include "InitializeThreading.h"
     27#include "JSArray.h"
     28#include "JSFunction.h"
    2629#include "JSGlobalObject.h"
    2730#include "JSLock.h"
     31#include "JSObject.h"
    2832#include "Parser.h"
    29 #include "ArrayPrototype.h"
    3033#include "collector.h"
    3134#include "completion.h"
    32 #include "JSFunction.h"
    33 #include "InitializeThreading.h"
    3435#include "interpreter.h"
    3536#include "nodes.h"
    36 #include "JSObject.h"
    3737#include "protect.h"
    3838#include <math.h>
  • trunk/JavaScriptCore/kjs/internal.cpp

    r34821 r34843  
    2525
    2626#include "ExecState.h"
    27 #include "ArrayPrototype.h"
    28 #include "BooleanObject.h"
    2927#include "collector.h"
    3028#include "date_object.h"
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r34838 r34843  
    2727#include "nodes.h"
    2828
    29 #include "ArrayPrototype.h"
    3029#include "CodeGenerator.h"
    3130#include "ExecState.h"
  • trunk/JavaScriptCore/kjs/string_object.cpp

    r34821 r34843  
    2323#include "string_object.h"
    2424
     25#include "JSArray.h"
    2526#include "JSWrapperObject.h"
    2627#include "PropertyNameArray.h"
    27 #include "ArrayPrototype.h"
     28#include "RegExpObject.h"
    2829#include "error_object.h"
    2930#include "operations.h"
    30 #include "RegExpObject.h"
    3131#include <wtf/MathExtras.h>
    3232#include <wtf/unicode/Collator.h>
Note: See TracChangeset for help on using the changeset viewer.