Changeset 48712 in webkit


Ignore:
Timestamp:
Sep 24, 2009 3:42:45 AM (15 years ago)
Author:
eric@webkit.org
Message:

2009-09-24 Benjamin Poulain <benjamin.poulain@nokia.com>

Reviewed by Eric Seidel.

The indices of RuntimeArray should be enumerated like for a regular array.
https://bugs.webkit.org/show_bug.cgi?id=29005

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

2009-09-24 Benjamin Poulain <benjamin.poulain@nokia.com>

Reviewed by Eric Seidel.

The indices of RuntimeArray should be enumerated like for a regular array.
https://bugs.webkit.org/show_bug.cgi?id=29005

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

2009-09-24 Benjamin Poulain <benjamin.poulain@nokia.com>

Reviewed by Eric Seidel.

https://bugs.webkit.org/show_bug.cgi?id=29005
The indices of RuntimeArray should be enumerated like for a regular array.

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r48701 r48712  
     12009-09-24  Benjamin Poulain  <benjamin.poulain@nokia.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        The indices of RuntimeArray should be enumerated like for a regular array.
     6        https://bugs.webkit.org/show_bug.cgi?id=29005
     7
     8        * platform/mac/fast/dom/wrapper-classes-objc-expected.txt:
     9        * platform/mac/fast/dom/wrapper-classes-objc.html:
     10
    1112009-09-23  Geoffrey Garen  <ggaren@apple.com>
    212
  • trunk/LayoutTests/platform/mac/fast/dom/wrapper-classes-objc-expected.txt

    r47901 r48712  
    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

    r47901 r48712  
    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

    r48710 r48712  
     12009-09-24  Benjamin Poulain  <benjamin.poulain@nokia.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        The indices of RuntimeArray should be enumerated like for a regular array.
     6        https://bugs.webkit.org/show_bug.cgi?id=29005
     7
     8        * bridge/runtime_array.cpp:
     9        (JSC::RuntimeArray::getPropertyNames):
     10        * bridge/runtime_array.h:
     11
    1122009-09-23  Alexander Pavlov  <apavlov@chromium.org>
    213
  • trunk/WebCore/bridge/runtime_array.cpp

    r47780 r48712  
    2929#include <runtime/ArrayPrototype.h>
    3030#include <runtime/Error.h>
     31#include <runtime/PropertyNameArray.h>
    3132#include "JSDOMBinding.h"
    3233
     
    146147}
    147148
     149void RuntimeArray::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames)
     150{
     151    const unsigned int length = getLength();
     152    for (unsigned i = 0; i < length; ++i)
     153        propertyNames.add(Identifier::from(exec, i));
     154
     155    JSObject::getPropertyNames(exec, propertyNames);
    148156}
     157
     158}
  • trunk/WebCore/bridge/runtime_array.h

    r47780 r48712  
    4444    virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
    4545    virtual bool deleteProperty(ExecState *exec, unsigned propertyName);
     46    virtual void getPropertyNames(ExecState*, PropertyNameArray&);
    4647   
    4748    virtual const ClassInfo *classInfo() const { return &s_info; }
  • trunk/WebKitTools/ChangeLog

    r48700 r48712  
     12009-09-24  Benjamin Poulain  <benjamin.poulain@nokia.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=29005
     6        The indices of RuntimeArray should be enumerated like for a regular array.
     7
     8        * DumpRenderTree/mac/ObjCController.m:
     9        (+[ObjCController isSelectorExcludedFromWebScript:]):
     10        (+[ObjCController webScriptNameForSelector:]):
     11        (-[ObjCController arrayOfString]):
     12
    1132009-09-23  David Kilzer  <ddkilzer@apple.com>
    214
  • trunk/WebKitTools/DumpRenderTree/mac/ObjCController.m

    r46340 r48712  
    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.