Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-16478 QtScript API changes for Qt 5
  3. QTBUG-16506

Consider removing QScriptValue::lessThan()

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Invalid
    • Not Evaluated
    • 5.0.0
    • Qt Script
    • None

    Description

      http://doc.trolltech.com/4.7/qscriptvalue.html#lessThan

      The first problem with this function is that it says it implements the algorithm in section 11.8.5 of the ES spec; however, that comparison can produce either a bool or undefined, whereas QScriptValue::lessThan() returns bool.

      The other issue is: What's the use case? For comparing numbers, QScriptValue::toNumber() and the C++ < operator can be used instead.
      General-purpose sorting can be done with Array.prototype.sort in JS.

      For the record, neither JavaScriptCore nor V8 expose a C/C++ API for this type of comparison; only for equality (equals / strictly equals).

      Attachments

        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