diff options
author | Lars Knoll <lars.knoll@digia.com> | 2012-11-11 21:56:38 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@digia.com> | 2012-11-12 09:17:23 +0100 |
commit | c5b258c21dea10e69e6977920c14c96368384933 (patch) | |
tree | e4274d59d2396883f8024e422880712ca7879747 /qmljs_objects.h | |
parent | b651c293b105bd4316d94d6321688406efbc0f20 (diff) |
Clean up inplace binary operations for subscripts.
Remove a lot of duplicated code, and make it a lot
easier to implement JS compliant semantics.
Change-Id: Ic5ecb58d34a5df8fe05e86c5f906d70c50c51b54
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'qmljs_objects.h')
-rw-r--r-- | qmljs_objects.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/qmljs_objects.h b/qmljs_objects.h index ebb2291586..6fae34d79f 100644 --- a/qmljs_objects.h +++ b/qmljs_objects.h @@ -413,6 +413,7 @@ struct Object { Value getValue(Context *ctx, PropertyDescriptor *p) const; bool inplaceBinOp(Value rhs, Context *ctx, String *name, BinOp op); + virtual bool inplaceBinOp(Value rhs, Value index, BinOp op, Context *ctx); }; struct ForEachIteratorObject: Object { @@ -460,6 +461,8 @@ struct ArrayObject: Object { virtual QString className() { return QStringLiteral("Array"); } virtual ArrayObject *asArrayObject() { return this; } virtual Value __get__(Context *ctx, String *name); + + virtual bool inplaceBinOp(Value rhs, Value index, BinOp op, Context *ctx); }; struct FunctionObject: Object { |