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

[Reg] Local variables implemented as getter/setter properties on the activation object no longer works

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P4: Low P4: Low
    • None
    • 4.6.0
    • Qt Script
    • None

      QScriptEngine eng;
      QScriptContext *ctx = eng.pushContext();
      QScriptValue act = ctx->activationObject();
      act.setProperty("act", act);
      eng.evaluate("act.__defineGetter__('x', function() { return 123; })");
      qDebug() << eng.evaluate("x").toString();
      

      With Qt 4.5, the above program prints "123", whereas with 4.6, it prints "ReferenceError: Can't find variable: x".
      I.e. you can no longer have local variables implemented as getter/setter properties.

        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