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

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

XMLWordPrintable

          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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes