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

evaluation context stack is broken

    XMLWordPrintable

Details

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

    Description

      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" 
      

      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)
              jbornema Joerg Bornemann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes