Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-11475 QtScript's patches to JavaScriptCore
  3. QTBUG-11715

[QtScript/JavaScriptCore] Add object comparison hook

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Invalid
    • P2: Important
    • None
    • Qt Script
    • None

    Description

      Patch: http://gitorious.org/+qtwebkit-developers/qtwebkit/qtwebkit-qtscript-integration/commit/3f79ddad39feadf0db573a00a21fbe2108b9747e

      This sucks badly. It's a deep hook for overloading the == operator when comparing two objects.
      In normal JavaScript, using == to compare two object references will only return true if the references are to the exact same object.
      In order to make the operator "more useful" for wrapped QObjects and QVariants, we override the operator in this case and compare the underlying value instead. This is completely non-standard.

      This behavior is not documented; it is unknown whether any users rely on it. Unfortunately the QtDeclarative module does rely on (and even extends the semantics of) == comparison. Need to determine the importance of that.

      It's likely that dropping this patch will cause stuff to break; on the other hand, there's no way this can be upstreamed. Consider introducing an "equals" function on some prototype and advise users to switch to that one.

      Proposed action: Keep the patch until alternative comparison method has been introduced.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kenthans Kent Hansen (Inactive)
              kenthans Kent Hansen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes