summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/AST.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-26 13:53:40 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-26 15:51:07 +0200
commitf897c410927817050c9f98081d45a32e893e6d73 (patch)
tree1b45402c82e1785b649d29c3252f1df9bdceb677 /Libraries/LibJS/AST.h
parent1617be1e6f1bb356ce1ae08d5443795a9c5f2f33 (diff)
downloadserenity-f897c410927817050c9f98081d45a32e893e6d73.zip
LibJS: Implement basic support for the "delete" operator
It turns out "delete" is actually a unary op :) This patch implements deletion of object properties, it doesn't yet work for casually deleting properties from the global object. When deleting a property from an object, we switch that object to having a unique shape, no longer sharing shapes with others. Once an object has a unique shape, it no longer needs to care about shape transitions.
Diffstat (limited to 'Libraries/LibJS/AST.h')
-rw-r--r--Libraries/LibJS/AST.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Libraries/LibJS/AST.h b/Libraries/LibJS/AST.h
index ba37df528a..bec3f2910a 100644
--- a/Libraries/LibJS/AST.h
+++ b/Libraries/LibJS/AST.h
@@ -400,6 +400,7 @@ enum class UnaryOp {
Minus,
Typeof,
Void,
+ Delete,
};
class UnaryExpression : public Expression {