Description
See http://doc.trolltech.com/4.7/qscriptengine.html#pushContext
pushContext() is used to open up a new "evaluation scope"; effectively, it creates a new JS stack frame in which JavaScript can be evaluated without "polluting" the outer scope.
This is useful functionality that we don't want to drop.
However, push/popContext() is too low-level; we would like not to expose the stack frames directly.
An alternative API could be something like this:
QScriptEngine eng; { QScriptEvaluationScope scope(&eng); eng.evaluate("var foo = 123"); // "foo" would be defined in local scope } eng.evaluate("foo"); // ReferenceError - the scope where "foo" was defined no longer exists
Attachments
Issue Links
- relates to
-
QTBUG-11719 [QtScript/JavaScriptCore] Fix the way the JS stack is advanced
-
- Closed
-