Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-33042

Strange JavaScript behavior on Mac OS X

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.2.0
    • 5.1.0
    • None
    • Mac OS X 10.8.4
    • macOS

    Description

      This seems a bug of QML.

      import QtQuick 2.0
      
      Rectangle {
          width: 360
          height: 360
      
          property int a: -1
          property int b: 1
      
          Component.onCompleted: {
              for (var i = 0; i < 10000; i++) {
                  var x = Math.min(a + 0, b + 0);
                  if (x > 0) {
                      console.log("min(-1,1) =", x);
                      console.log("loop count =", i);
                      return;
                  }
              }
              console.log("OK");
          }
      }
      

      Output on my environment:

      min(-1,1) = 1
      loop count = 5891
      

      Attachments

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

        Activity

          People

            aalpert Alan Alpert
            sqq S.Gold
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes