Bug 22880

Summary: Convert javascript Number Object or Boolean Object to Qt types in QtWebKit.
Product: WebKit Reporter: jade han <jade.han>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: hausmann, vestbo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
This patch implements the feature
vestbo: review-
Removes changes under QVariantMap hint; redirect to Qt bool and double hint respectively in the autoswitch; remove object from visited array before recursive call vestbo: review+

Description jade han 2008-12-16 10:51:11 PST
Convert javascript built-in Number Object to double in Qt; Convert javascript built-in Boolean Object to bool in Qt.
Comment 1 jade han 2008-12-16 11:10:30 PST
Created attachment 26056 [details]
This patch implements the feature
Comment 2 Tor Arne Vestbø 2008-12-18 05:35:11 PST
Comment on attachment 26056 [details]
This patch implements the feature

> +    // if hint is const QVariant& and type is Object, 
> +    // because the visitedObjects check at the beginging of this function,
> +    // make sure it's handled as QVariantMap upon the first time entering this function
> +    if (hint == (QMetaType::Type) qMetaTypeId<QVariant>() && type == Object)
> +        hint = QMetaType::QVariantMap;

I think we should remove the object from the visitedObjects when recursing with the auto-detect flag instead.

>          case QMetaType::QVariantMap: 
> +                // Javascript built-in Number and Boolean object don't have properties,
> +                // convert them to double and bool respectively

Some auto-tests for this would be nice.
Comment 3 jade han 2008-12-18 08:05:46 PST
Created attachment 26120 [details]
Removes changes under QVariantMap hint; redirect to Qt bool and double hint respectively in the autoswitch; remove object from visited array before recursive call
Comment 4 Tor Arne Vestbø 2008-12-19 02:43:38 PST
Thanks! Landed in r39399