--===============4650803647385163251== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable > On April 29, 2012, 6:26 p.m., Maks Orlovich wrote: > > kjs/object.cpp, line 433 > > > > > > more * inconsistency > = > Bernd Buschinski wrote: > I don't get the problem here, could you please explain? GetterSetterImp *gs -> GetterSetterImp* gs - Rolf Eike ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/104515/#review13085 ----------------------------------------------------------- On June 1, 2012, 12:34 p.m., Bernd Buschinski wrote: > = > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://git.reviewboard.kde.org/r/104515/ > ----------------------------------------------------------- > = > (Updated June 1, 2012, 12:34 p.m.) > = > = > Review request for kdelibs. > = > = > Description > ------- > = > KJS: Implement Object.GetOwnPropertyDescriptor & Object.DefineProperty > = > This is a pretty big patch, to get Object.defineProperty perfect for ecma= script (for all tests that only use implemented stuff, all test that use Ob= ject.create for example will fail, as its not implemented) > = > PropertyDescriptor: > Necessary for collectiong data, this introduce new CommonIdentifiers.h, t= his might requiere to rebuild khtml against new kjs, otherwise it might cau= se weird crashes (at least for me) > = > = > object.h: > Beside from adding new getPropertyDescriptor & getOwnPropertyDescriptor &= defineOwnProperty, the important changes are making > getPropertyAttributes, put/get/remove-Direct virtual. > Why do I need that? > Because put checks if the prototype already has property XYZ and uses it.= Now imagine an array that got a setter-only property via a prototype. Defi= neProperty would try to use put, which uses the prototype property and it w= ould fail. So all custom-data classes like Array need to implement/use put/= get/remove-Direct. > = > = > object.cpp: > currently put on a setter-only property would always throw an exception, = this is only correct for strict-mode, as we currently do not check for stri= ct-mode it would make more sense to change it to default not throwing an ex= ception. > = > = > array.cpp/h: > The old Array implementation did not store attributes for array indexes, = I rewrote it to also store the attributes. > + Bonus: also fix getOwnPropertyNames, as we now store attributes. > + use new attributes, reject put/delete/enum if set > = > function.cpp (Arguments) > changed the default attributes how parameter are stored, according to ECM= A 10.6.11.b > = > = > Rest is "just" the defineProperty implementation > = > = > Diffs > ----- > = > kjs/CMakeLists.txt 1188064 = > kjs/CommonIdentifiers.h 8ee40e8 = > kjs/array_instance.h 3f2b630 = > kjs/array_instance.cpp fe9b8b4 = > kjs/function.h 3757fe8 = > kjs/function.cpp 5f39ae6 = > kjs/object.h 047c242 = > kjs/object.cpp c19122f = > kjs/object_object.cpp 986f03f = > kjs/operations.h f8a28c8 = > kjs/operations.cpp d4c0066 = > kjs/propertydescriptor.h PRE-CREATION = > kjs/propertydescriptor.cpp PRE-CREATION = > = > Diff: http://git.reviewboard.kde.org/r/104515/diff/ > = > = > Testing > ------- > = > ecmascript & daily surfing > = > used valgrind on many array testcases to check for possible memleaks > = > = > Thanks, > = > Bernd Buschinski > = > --===============4650803647385163251== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable
This is an automatically generated e-mail. To reply, visit: http://git.revie= wboard.kde.org/r/104515/

On April 29th, 2012, 6:26 p.m., Maks Orlovi= ch wrote:

= = =
kjs/object.cpp (Diff revision 4)
bool JSObject::defineOwnProperty(ExecState* exec, const Identifier&=
amp; propertyName, PropertyDescriptor& desc, bool shouldThrow)
433
            GetterSetterImp<=
/span> *gs =3D new GetterSetterI=
mp();
more * in=
consistency

On April 30th, 2012, 7:11 p.m., Bernd Buschinski wrote:

I don'=
;t get the problem here, could you please explain?
GetterSetterImp *gs -> GetterSetterImp* gs

- Rolf Eike


On June 1st, 2012, 12:34 p.m., Bernd Buschinski wrote:

Review request for kdelibs.
By Bernd Buschinski.

Updated June 1, 2012, 12:34 p.m.

Descripti= on

KJS: Implement Object.GetOwnPropertyDescriptor & Object.=
DefineProperty

This is a pretty big patch, to get Object.defineProperty perfect for ecmasc=
ript (for all tests that only use implemented stuff, all test that use Obje=
ct.create for example will fail, as its not implemented)

PropertyDescriptor:
Necessary for collectiong data, this introduce new CommonIdentifiers.h, thi=
s might requiere to rebuild khtml against new kjs, otherwise it might cause=
 weird crashes (at least for me)


object.h:
Beside from adding new getPropertyDescriptor & getOwnPropertyDescriptor=
 & defineOwnProperty, the important changes are making
getPropertyAttributes, put/get/remove-Direct virtual.
Why do I need that?
Because put checks if the prototype already has property XYZ and uses it. N=
ow imagine an array that got a setter-only property via a prototype. Define=
Property would try to use put, which uses the prototype property and it wou=
ld fail. So all custom-data classes like Array need to implement/use put/ge=
t/remove-Direct.


object.cpp:
currently put on a setter-only property would always throw an exception, th=
is is only correct for strict-mode, as we currently do not check for strict=
-mode it would make more sense to change it to default not throwing an exce=
ption.


array.cpp/h:
The old Array implementation did not store attributes for array indexes, I =
rewrote it to also store the attributes.
+ Bonus: also fix getOwnPropertyNames, as we now store attributes.
+ use new attributes, reject put/delete/enum if set

function.cpp (Arguments)
changed the default attributes how parameter are stored, according to ECMA =
10.6.11.b



Rest is "just" the defineProperty implementation

Testing <= /h1>
ecmascript & daily surfing

used valgrind on many array testcases to check for possible memleaks

Diffs=

  • kjs/CMakeLists.txt (1188064)
  • kjs/CommonIdentifiers.h (8ee40e8)
  • kjs/array_instance.h (3f2b630)
  • kjs/array_instance.cpp (fe9b8b4)
  • kjs/function.h (3757fe8)
  • kjs/function.cpp (5f39ae6)
  • kjs/object.h (047c242)
  • kjs/object.cpp (c19122f)
  • kjs/object_object.cpp (986f03f)
  • kjs/operations.h (f8a28c8)
  • kjs/operations.cpp (d4c0066)
  • kjs/propertydescriptor.h (PRE-CREATION)
  • kjs/propertydescriptor.cpp (PRE-CREATION)<= /span>

View Diff

--===============4650803647385163251==--