aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4object_p.h
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@crimson.no>2017-02-02 18:37:21 +0100
committerRobin Burchell <robin.burchell@crimson.no>2017-02-03 15:10:33 +0000
commit6653fdb6bfb538b601685966ad96e055bafbdbcf (patch)
treef74cff62762f2c427a7d9d9324dfa8203be576f0 /src/qml/jsruntime/qv4object_p.h
parentdd31156c6c6b120c88fff3be17ea1290a964e193 (diff)
FunctionObject: Mark name/length property configurable
In ES5, these were not configurable, but ES6 changed the behavior. For length, refer to: 9.2.4 (FunctionInitialize) 17 (ECMAScript Standard Built-in Objects): Unless otherwise specified, the length property of a built-in Function object has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. 19.2.2.1 Function.length 19.2.3.2 (Function.prototype.bind) 19.2.4.1 (Function instances, length) For name, refer to: 9.2.11 (SetFunctionName) This does regress test262 for ES5 for me a little, but improves our es6 test coverage a bit (~682 more tests pass, +1.5%). Change-Id: Icda7c9068dc3e6e4e4aebbb0d359868a30343013 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4object_p.h')
-rw-r--r--src/qml/jsruntime/qv4object_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h
index 6a543ae1a8..a54e09cdb2 100644
--- a/src/qml/jsruntime/qv4object_p.h
+++ b/src/qml/jsruntime/qv4object_p.h
@@ -253,6 +253,10 @@ struct Q_QML_EXPORT Object: Managed {
void defineReadonlyProperty(const QString &name, const Value &value);
void defineReadonlyProperty(String *name, const Value &value);
+ /* Fixed: Writable: false, Enumerable: false, Configurable: true */
+ void defineReadonlyConfigurableProperty(const QString &name, const Value &value);
+ void defineReadonlyConfigurableProperty(String *name, const Value &value);
+
void insertMember(String *s, const Value &v, PropertyAttributes attributes = Attr_Data) {
Scope scope(engine());
ScopedProperty p(scope);