This makes expressions such as typeof(this) work
correctly.
Change-Id: I44270f877fdee648e69ae44089ffc8fb57243401
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
id_prototype = identifier(QStringLiteral("prototype"));
id_constructor = identifier(QStringLiteral("constructor"));
id_arguments = identifier(QStringLiteral("arguments"));
+ id_this = identifier(QStringLiteral("this"));
id___proto__ = identifier(QStringLiteral("__proto__"));
id_enumerable = identifier(QStringLiteral("enumerable"));
id_configurable = identifier(QStringLiteral("configurable"));
String *id_prototype;
String *id_constructor;
String *id_arguments;
+ String *id_this;
String *id___proto__;
String *id_enumerable;
String *id_configurable;
Value ExecutionContext::getProperty(String *name)
{
+ if (name == engine->id_this)
+ return thisObject;
+
for (ExecutionContext *ctx = this; ctx; ctx = ctx->outer()) {
if (ctx->withObject) {
With *w = ctx->withObject;
Value ExecutionContext::getPropertyNoThrow(String *name)
{
+ if (name == engine->id_this)
+ return thisObject;
+
for (ExecutionContext *ctx = this; ctx; ctx = ctx->outer()) {
if (ctx->withObject) {
With *w = ctx->withObject;