Bug 22880 - Convert javascript Number Object or Boolean Object to Qt types in QtWebKit.
Summary: Convert javascript Number Object or Boolean Object to Qt types in QtWebKit.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-16 10:51 PST by jade han
Modified: 2008-12-19 02:44 PST (History)
2 users (show)

See Also:


Attachments
This patch implements the feature (7.89 KB, patch)
2008-12-16 11:10 PST, jade han
vestbo: review-
Details | Formatted Diff | Diff
Removes changes under QVariantMap hint; redirect to Qt bool and double hint respectively in the autoswitch; remove object from visited array before recursive call (5.73 KB, patch)
2008-12-18 08:05 PST, jade han
vestbo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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