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

[Reg] JS getter that throws exception is not returned by QScriptValue::property()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 4.6.0
    • Qt Script
    • None

    Description

      QScriptEngine eng;
      QScriptValue str = QScriptValue(&eng, "bar");
      
      eng.evaluate("o = new Object; "
                   "o.__defineGetter__('foo', function() { throw new Error('get foo') }); "
                   "o.__defineSetter__('foo', function() { throw new Error('set foo') }); ");
      QScriptValue object = eng.evaluate("o");
      QScriptValue ret = object.property("foo");
      qWarning() << ret.toString();
      

      With Qt 4.5, the above program prints "Error: get foo", but since 4.6, it prints "null".

      Attachments

        Issue Links

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

          Activity

            People

              kenthans Kent Hansen (Inactive)
              kenthans Kent Hansen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes