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

Function.prototype.call() on undefined results in error

    XMLWordPrintable

Details

    Description

          QJSEngine engine;
          QJSValue result = engine.evaluate(QStringLiteral("Array.prototype.map.call(undefined, function (a) {return a; } );"));
          qDebug() << result.toString(); 

      Results in 

      "TypeError: Value is undefined and could not be converted to an object" 

      I believe that this is not correct. The expected behavior is that an undefined this parameter is converted to the global object unless strict mode is enabled.

      Attachments

        Issue Links

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              rweickelt Richard Weickelt
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: