diff options
author | Lars Knoll <lars.knoll@digia.com> | 2012-12-13 00:53:04 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-12-12 16:07:18 +0100 |
commit | c28f8c7b409fdd7214bb721c4192374786ec682f (patch) | |
tree | 7df99ac24c439f6349593d2723af5e40ace6ba0a /qmljs_objects.h | |
parent | 949303cd7da0edcab235bc19d5fad7d4af7eaed3 (diff) |
Fix access rights for builtin properties
According to the spec all builtin properties have
writable: true, enumerable: false and configurable:true
by default. This is what is now being used. Some constants
have all attributes set to false, and there is an extra
method for setting these readonly properties.
Change-Id: If5ba875bcc9f1644aa8a07a2d9b37716bf228e12
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'qmljs_objects.h')
-rw-r--r-- | qmljs_objects.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/qmljs_objects.h b/qmljs_objects.h index 1b0b67fab9..14218e7be1 100644 --- a/qmljs_objects.h +++ b/qmljs_objects.h @@ -457,12 +457,18 @@ struct Object: Managed { // helpers // void __put__(ExecutionContext *ctx, const QString &name, const Value &value); - void __put__(ExecutionContext *ctx, const QString &name, Value (*code)(ExecutionContext *), int count = 0); Value getValue(ExecutionContext *ctx, PropertyDescriptor *p) const; bool inplaceBinOp(Value rhs, String *name, BinOp op, ExecutionContext *ctx); virtual bool inplaceBinOp(Value rhs, Value index, BinOp op, ExecutionContext *ctx); + /* The spec default: Writable: true, Enumerable: false, Configurable: true */ + void defineDefaultProperty(String *name, Value value); + void defineDefaultProperty(ExecutionContext *context, const QString &name, Value value); + void defineDefaultProperty(ExecutionContext *context, const QString &name, Value (*code)(ExecutionContext *), int count = 0); + /* Fixed: Writable: false, Enumerable: false, Configurable: false */ + void defineReadonlyProperty(ExecutionEngine *engine, const QString &name, Value value); + protected: virtual void getCollectables(QVector<Object *> &objects); }; |