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

Maks Orlovich maksim at kde.org
Tue Apr 10 03:38:29 BST 2012


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



kjs/function.cpp
<http://git.reviewboard.kde.org/r/104511/#comment9642>

    How should this react when the length property is altered?
    



kjs/function.cpp
<http://git.reviewboard.kde.org/r/104511/#comment9643>

    Why convert to ident when isMapped will convert back to number again? Just add  aversion that takes a number; similarly [] works on numbers already. (And perhaps fix up some of the sloppiness with signs there)



kjs/object.h
<http://git.reviewboard.kde.org/r/104511/#comment9644>

    It's OK to make API changes here; just make sure you fix every call site. Frankly, past experience shows that overloaded virtual groups like this are a mistake and hard to get right (there have been bugs caused with the getters, for example).
    



kjs/object.cpp
<http://git.reviewboard.kde.org/r/104511/#comment9645>

    This might actually show up on some benchmarks. I bet you can speed this up by making an appropriate choice of value for PropertyMap::IncludeDontEnumProperties -- basically making it a mask on attr, but that may be a bit brittle maintenance wise



kjs/object_object.cpp
<http://git.reviewboard.kde.org/r/104511/#comment9647>

    For these comments, could you include the spec version? 
    
    Reason: we have a whole bunch of the around already... From something older than the 3rd edition. (Dunno if from 2nd or 1st..)
    



kjs/object_object.cpp
<http://git.reviewboard.kde.org/r/104511/#comment9648>

    Faster: save return value of getObject() and check that for null. (Note that it matters here..)



kjs/object_object.cpp
<http://git.reviewboard.kde.org/r/104511/#comment9649>

    So this one shows the DontEnum ones? Joy. 



kjs/object_object.cpp
<http://git.reviewboard.kde.org/r/104511/#comment9650>

    I think you could merge this implementation with the above; the only difference is what gets passed to getOwnPropertyNames as last argument, isn't it? This is way too much to duplicate..


- Maks Orlovich


On April 8, 2012, 9:14 p.m., Bernd Buschinski wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/104511/
> -----------------------------------------------------------
> 
> (Updated April 8, 2012, 9:14 p.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/20120410/7845c058/attachment.htm>


More information about the kde-core-devel mailing list