Review Request: KJS: Implement Object.prototypeOf, Object.keys, Object.getOwnPropertyNames

Bernd Buschinski b.buschinski at googlemail.com
Mon Apr 16 18:51:07 BST 2012



> On April 15, 2012, 2:55 p.m., Maks Orlovich wrote:
> > kjs/function.cpp, line 302
> > <http://git.reviewboard.kde.org/r/104511/diff/1/?file=56157#file56157line302>
> >
> >     re: if length changed --- I think this should be using ->size from indexToNameMap rather than the length property. Why? Because setting length on an arguments object of a 2-argument function doesn't make [0] and [1] DontEnum.

ok, fixed, introduced new public getter size() to IndexToNameMap


> On April 15, 2012, 2:55 p.m., Maks Orlovich wrote:
> > kjs/object_object.cpp, line 262
> > <http://git.reviewboard.kde.org/r/104511/diff/1/?file=56160#file56160line262>
> >
> >     This is actually my big objection --- there is too much duplication between the two, when it could be one conditional.

Can it be you looked the old r1?


> On April 15, 2012, 2:55 p.m., Maks Orlovich wrote:
> > kjs/property_map.cpp, line 680
> > <http://git.reviewboard.kde.org/r/104511/diff/1/?file=56162#file56162line680>
> >
> >     I wonder if a nice inline helper for this 
> >      (!(e->attributes & DontEnum) || mode == IncludeDontEnumProperties) is possible? It's just a hair too ugly for the number of places it's in.

introduced
static bool checkEnumerable(unsigned int attr, PropertyMode mode);
which gcc inlines with -O1 and higher, so no extra call, beside from -O0


- Bernd


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/104511/#review12471
-----------------------------------------------------------


On April 13, 2012, 9:38 a.m., Bernd Buschinski wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/104511/
> -----------------------------------------------------------
> 
> (Updated April 13, 2012, 9:38 a.m.)
> 
> 
> Review request for kdelibs.
> 
> 
> Description
> -------
> 
> KJS: Implement Object.prototypeOf, Object.keys, Object.getOwnPropertyNames
> 
> NOTE: Array was left out on purpose, as currentl imeplementation does not save attributes (next patch will fix this)
> 
> keys&GetOwnPropertyNames requieres to change the JSObject::getOwnPropertyNames implementation,
> for future use a enum is better than than a bool, maybe there will be more ways to include/exclude properties.
> 
> All changes for khtml/ecma/ are to silense the -Woverloaded-virtual warnings
> 
> 
> Diffs
> -----
> 
>   khtml/ecma/kjs_css.h aba44b8 
>   khtml/ecma/kjs_css.cpp e3e7417 
>   khtml/ecma/kjs_dom.h d0433c3 
>   khtml/ecma/kjs_dom.cpp 5fff7e3 
>   khtml/ecma/kjs_html.h 0f3f544c 
>   khtml/ecma/kjs_html.cpp e3da95c 
>   khtml/ecma/kjs_scriptable.h af5343c 
>   khtml/ecma/kjs_scriptable.cpp 5d4ea68 
>   kjs/JSVariableObject.h a8f01eb 
>   kjs/JSVariableObject.cpp b00ef76 
>   kjs/array_instance.h 3f2b630 
>   kjs/function.h 3757fe8 
>   kjs/function.cpp 5f39ae6 
>   kjs/object.h 047c242 
>   kjs/object.cpp c19122f 
>   kjs/object_object.cpp 986f03f 
>   kjs/property_map.h 6b127ff 
>   kjs/property_map.cpp b2ff08e 
>   kjs/string_object.h e890d52 
>   kjs/string_object.cpp 170e2f7 
> 
> Diff: http://git.reviewboard.kde.org/r/104511/diff/
> 
> 
> Testing
> -------
> 
> ecma script & daily surfing
> 
> 
> Thanks,
> 
> Bernd Buschinski
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20120416/7a3d881a/attachment.htm>


More information about the kde-core-devel mailing list