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

Instantiating an object without constructor prints only 'TypeError: Type error'

    XMLWordPrintable

Details

    Description

      The following code:

              QJSEngine e;
              QJSValue o = e.newObject();
              e.globalObject().setProperty(QStringLiteral("Blub"), o);
              QJSValue r = e.evaluate(QStringLiteral("new Blub()"));
              qWarning() << r.toString();
      

      prints only: Type Error: Type Error.

      QScriptEngine instead printed: 'Blub' cannot be instantiated.

      Would it be possible to print such a nice error message in QJSEngine as well?

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes