Changeset 51985 in webkit


Ignore:
Timestamp:
Dec 11, 2009 7:21:55 AM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-11 Benjamin Poulain <benjamin.poulain@nokia.com>

Reviewed by Darin Adler.

The values of RuntimeArray are not enumerable
https://bugs.webkit.org/show_bug.cgi?id=29005

The indices of RuntimeArray should be enumerated like for a regular array.

  • platform/mac/fast/dom/wrapper-classes-objc-expected.txt:
  • platform/mac/fast/dom/wrapper-classes-objc.html:

2009-12-11 Benjamin Poulain <benjamin.poulain@nokia.com>

Reviewed by Darin Adler.

The values of RuntimeArray are not enumerable
https://bugs.webkit.org/show_bug.cgi?id=29005

The indices of RuntimeArray should be enumerated like for a regular array.

  • bridge/runtime_array.cpp: (JSC::RuntimeArray::getOwnPropertyNames):
  • bridge/runtime_array.h:

2009-12-11 Benjamin Poulain <benjamin.poulain@nokia.com>

Reviewed by Darin Adler.

The values of RuntimeArray are not enumerable
https://bugs.webkit.org/show_bug.cgi?id=29005

  • DumpRenderTree/mac/ObjCController.m: (+[ObjCController isSelectorExcludedFromWebScript:]): (+[ObjCController webScriptNameForSelector:]): (-[ObjCController arrayOfString]):
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r51982 r51985  
     12009-12-11  Benjamin Poulain  <benjamin.poulain@nokia.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        The values of RuntimeArray are not enumerable
     6        https://bugs.webkit.org/show_bug.cgi?id=29005
     7
     8        The indices of RuntimeArray should be enumerated like for a regular array.
     9
     10        * platform/mac/fast/dom/wrapper-classes-objc-expected.txt:
     11        * platform/mac/fast/dom/wrapper-classes-objc.html:
     12
    1132009-12-11  Simon Hausmann  <hausmann@webkit.org>
    214
  • trunk/LayoutTests/platform/mac/fast/dom/wrapper-classes-objc-expected.txt

    r48715 r51985  
    193193PASS typeof objCObjectOfClass('WebScriptObject') is 'object'
    194194PASS objCObjectOfClass('NSArray') instanceof Array is true
     195PASS concatenateArray(objCArrayOfString()) is 'onetwothree'
    195196
  • trunk/LayoutTests/platform/mac/fast/dom/wrapper-classes-objc.html

    r48715 r51985  
    3333        return "only works under DumpRenderTree";
    3434    return objCController.objectOfClass(name);
     35}
     36
     37function objCArrayOfString()
     38{
     39    if (!window.objCController)
     40        return "only works under DumpRenderTree";
     41    return objCController.arrayOfString();
     42}
     43
     44function concatenateArray(array)
     45{
     46    var result = '';
     47    for (i in array)
     48        result += array[i];
     49    return result;
    3550}
    3651
     
    273288    shouldBeTrue("objCObjectOfClass('NSArray') instanceof Array");
    274289
     290    shouldBe("concatenateArray(objCArrayOfString())", "'onetwothree'");
     291
    275292    // Not yet tested:
    276293
  • trunk/WebCore/ChangeLog

    r51983 r51985  
     12009-12-11  Benjamin Poulain  <benjamin.poulain@nokia.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        The values of RuntimeArray are not enumerable
     6        https://bugs.webkit.org/show_bug.cgi?id=29005
     7
     8        The indices of RuntimeArray should be enumerated like for a regular array.
     9
     10        * bridge/runtime_array.cpp:
     11        (JSC::RuntimeArray::getOwnPropertyNames):
     12        * bridge/runtime_array.h:
     13
    1142009-12-11  Andreas Kling  <andreas.kling@nokia.com>
    215
  • trunk/WebCore/bridge/runtime_array.cpp

    r48715 r51985  
    2929#include <runtime/ArrayPrototype.h>
    3030#include <runtime/Error.h>
     31#include <runtime/PropertyNameArray.h>
    3132#include "JSDOMBinding.h"
    3233
     
    5556    RuntimeArray* thisObj = static_cast<RuntimeArray*>(asObject(slot.slotBase()));
    5657    return thisObj->getConcreteArray()->valueAt(exec, slot.index());
     58}
     59
     60void RuntimeArray::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames)
     61{
     62    unsigned length = getLength();
     63    for (unsigned i = 0; i < length; ++i)
     64        propertyNames.add(Identifier::from(exec, i));
     65
     66    JSObject::getOwnPropertyNames(exec, propertyNames);
    5767}
    5868
  • trunk/WebCore/bridge/runtime_array.h

    r49835 r51985  
    3535public:
    3636    RuntimeArray(ExecState*, Bindings::Array*);
    37    
     37
     38    virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&);
    3839    virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
    3940    virtual bool getOwnPropertySlot(ExecState *, unsigned, PropertySlot&);
  • trunk/WebKitTools/ChangeLog

    r51972 r51985  
     12009-12-11  Benjamin Poulain  <benjamin.poulain@nokia.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        The values of RuntimeArray are not enumerable
     6        https://bugs.webkit.org/show_bug.cgi?id=29005
     7
     8        * DumpRenderTree/mac/ObjCController.m:
     9        (+[ObjCController isSelectorExcludedFromWebScript:]):
     10        (+[ObjCController webScriptNameForSelector:]):
     11        (-[ObjCController arrayOfString]):
     12
    1132009-12-10  Eric Seidel  <eric@webkit.org>
    214
  • trunk/WebKitTools/DumpRenderTree/mac/ObjCController.m

    r48715 r51985  
    5959            || aSelector == @selector(classNameOf:)
    6060            || aSelector == @selector(objectOfClass:)
     61            || aSelector == @selector(arrayOfString)
    6162            || aSelector == @selector(identityIsEqual::)
    6263            || aSelector == @selector(longLongRoundTrip:)
     
    7879    if (aSelector == @selector(objectOfClass:))
    7980        return @"objectOfClass";
     81    if (aSelector == @selector(arrayOfString))
     82        return @"arrayOfString";
    8083    if (aSelector == @selector(identityIsEqual::))
    8184        return @"identityIsEqual";
     
    123126}
    124127
     128- (NSArray *)arrayOfString
     129{
     130    NSString *strings[3];
     131    strings[0] = @"one";
     132    strings[1] = @"two";
     133    strings[2] = @"three";
     134    NSArray *array = [NSArray arrayWithObjects:strings count:3];
     135    return array;
     136}
     137
    125138- (BOOL)identityIsEqual:(WebScriptObject *)a :(WebScriptObject *)b
    126139{
Note: See TracChangeset for help on using the changeset viewer.