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

Critical Javascript evaluation order error

    XMLWordPrintable

Details

    • All
    • 872e91612f (qt/qtdeclarative/dev) 872e91612f (qt/qtdeclarative/wip/material3) 872e91612f (qt/tqtc-qtdeclarative/dev)

    Description

      I think I found a critical bug in Qt's Javascript engine. Here's a minimal example that triggers it. It is quite self-explanatory:

      function myFunc(arg) {
          console.log("myFunc invoked", arg);
      };
      let array = [myFunc, "string"];
      array[0](array.reverse());
      

      The code does actually invoke the function in browsers and in nodejs. But not in V4 where it gives "Type Error". Looks like V4 evaluates array[0] only after array.reverse() has been performed.

      I stumbled on this behaviour while running obfuscated js code but I guess this could happen even in human-written code. IMO this bug should be top-priority.

      Attachments

        Activity

          People

            ulherman Ulf Hermann
            flaviotordini Flavio Tordini
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: