⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 119484 in webkit


Ignore:
Timestamp:
Jun 5, 2012, 5:27:44 AM (14 years ago)
Author:
charles.wei@torchmobile.com.cn
Message:

JSC:need to implement Dictionary::getWithUndefinedOrNullCheck for IDB
https://bugs.webkit.org/show_bug.cgi?id=88283

Reviewed by Kentaro Hara.

No new tests, idb not working for JSC yet.

  • bindings/js/Dictionary.cpp:

(WebCore::Dictionary::getWithUndefinedOrNullCheck):

  • bindings/js/Dictionary.h:

(Dictionary):

  • bindings/js/JSDictionary.cpp:

(WebCore::JSDictionary::getWithUndefinedOrNullCheck):
(WebCore):

  • bindings/js/JSDictionary.h:

(JSDictionary):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r119482 r119484  
     12012-06-05  Charles Wei  <charles.wei@torchmobile.com.cn>
     2
     3        JSC:need to implement Dictionary::getWithUndefinedOrNullCheck for IDB
     4        https://bugs.webkit.org/show_bug.cgi?id=88283
     5
     6        Reviewed by Kentaro Hara.
     7
     8        No new tests, idb not working for JSC yet.
     9
     10        * bindings/js/Dictionary.cpp:
     11        (WebCore::Dictionary::getWithUndefinedOrNullCheck):
     12        * bindings/js/Dictionary.h:
     13        (Dictionary):
     14        * bindings/js/JSDictionary.cpp:
     15        (WebCore::JSDictionary::getWithUndefinedOrNullCheck):
     16        (WebCore):
     17        * bindings/js/JSDictionary.h:
     18        (JSDictionary):
     19
    1202012-06-05  Dongwoo Im  <dw.im@samsung.com>
    221
  • trunk/Source/WebCore/bindings/js/Dictionary.cpp

    r116763 r119484  
    8080}
    8181
     82bool Dictionary::getWithUndefinedOrNullCheck(const String& propertyName, String& value) const
     83{
     84    return m_dictionary.getWithUndefinedOrNullCheck(propertyName, value);
     85}
     86
    8287};
    83 
  • trunk/Source/WebCore/bindings/js/Dictionary.h

    r116763 r119484  
    6262    bool isUndefinedOrNull() const { return !m_dictionary.isValid(); }
    6363    bool getOwnPropertiesAsStringHashMap(WTF::HashMap<String, String>&) const;
    64     bool getWithUndefinedOrNullCheck(const String&, String&) const { notImplemented(); return false; }
     64    bool getWithUndefinedOrNullCheck(const String& propertyName, String& value) const;
    6565
    6666private:
  • trunk/Source/WebCore/bindings/js/JSDictionary.cpp

    r117646 r119484  
    168168#endif
    169169
     170bool JSDictionary::getWithUndefinedOrNullCheck(const String& propertyName, String& result) const
     171{
     172    JSValue value;
     173    if (tryGetProperty(propertyName.utf8().data(), value) != PropertyFound || value.isUndefinedOrNull())
     174        return false;
     175
     176    result = ustringToString(value.toString(m_exec)->value(m_exec));
     177    return true;
     178}
     179
    170180} // namespace WebCore
  • trunk/Source/WebCore/bindings/js/JSDictionary.h

    r116763 r119484  
    5959    template <typename Result>
    6060    bool get(const char* propertyName, Result&) const;
     61    bool getWithUndefinedOrNullCheck(const String& propertyName, String& value) const;
    6162
    6263    JSC::ExecState* execState() const { return m_exec; }
Note: See TracChangeset for help on using the changeset viewer.