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

evaluation context stack is broken

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.0.0 Beta 1
    • Qt Script
    • None
    • gcc (Debian 4.7.1-7) 4.7.1

      The following code

      #include <QCoreApplication>
      #include <QtScript>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
          QScriptEngine *engine = new QScriptEngine(&a);
          QScriptContext *ctx = engine->pushContext();
          ctx->activationObject().setProperty("Egon", engine->newVariant("Olsen"));
          qDebug() << engine->evaluate("Egon").toString();
          engine->pushContext();
          qDebug() << engine->evaluate("Egon").toString();
          engine->popContext();
          engine->popContext();
          return 0;
      }
      

      produces in Qt 4.8 the output

      "Olsen" 
      "Olsen"
      

      and in Qt 5.0

      "Olsen" 
      "ReferenceError: Can't find variable: Egon" 
      

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes