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

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

XMLWordPrintable

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

      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".

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes