aboutsummaryrefslogtreecommitdiffstats
path: root/qmljs_runtime.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2012-11-25 00:26:28 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-25 10:21:12 +0100
commit15326415d127e17016b60820b85c85016c3682e6 (patch)
tree4bc0df4dee49d6649c164cca56b547598b8969f2 /qmljs_runtime.cpp
parent87b31798170233b92f13ba4d39e0278fdf61e10e (diff)
Fix some issues with the delete operator
Properly implement delete operator for identifiers and local variables. Change-Id: I8ac55edc80c31a94d11444c9f5c78caf4b131c95 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'qmljs_runtime.cpp')
-rw-r--r--qmljs_runtime.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/qmljs_runtime.cpp b/qmljs_runtime.cpp
index eabceeff7f..86d1bbea09 100644
--- a/qmljs_runtime.cpp
+++ b/qmljs_runtime.cpp
@@ -195,18 +195,9 @@ Value __qmljs_delete_member(ExecutionContext *ctx, Value base, String *name)
return Value::fromBoolean(obj.objectValue()->__delete__(ctx, name, true));
}
-Value __qmljs_delete_property(ExecutionContext *ctx, String *name)
+Value __qmljs_delete_name(ExecutionContext *ctx, String *name)
{
- Object *obj = ctx->lexicalEnvironment->activation;
- if (!obj)
- obj = ctx->engine->globalObject.objectValue();
- return Value::fromBoolean(obj->__delete__(ctx, name, true));
-}
-
-Value __qmljs_delete_value(ExecutionContext *ctx, Value value)
-{
- Q_UNUSED(value);
- return __qmljs_throw_type_error(ctx); // ### throw syntax error
+ return Value::fromBoolean(ctx->deleteProperty(name));
}
Value __qmljs_add_helper(Value left, Value right, ExecutionContext *ctx)