diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-09-01 10:20:49 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-09-04 18:25:10 +0000 |
commit | 656db7a425fec6661ee3b42b89594a3e28637cdd (patch) | |
tree | b3546bd33b128d2789b70b98e1122b903937bc33 /src/qml/jsruntime/qv4functionobject_p.h | |
parent | a0a702cd9a315946a1b35dfe54d2dc965210ab6e (diff) |
Don't define a prototype property for most functions
Only functions that are constructors should have a prototype
property.
Change-Id: Ifcf6f8b6c38de055d871d57ada38a23432974263
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject_p.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index 766960d2ac..5976fd8f78 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -76,7 +76,6 @@ namespace Heap { DECLARE_HEAP_OBJECT(FunctionObject, Object) { DECLARE_MARKOBJECTS(FunctionObject); enum { - Index_Prototype = 0, Index_ProtoConstructor = 0 }; @@ -116,7 +115,7 @@ struct IndexedBuiltinFunction : FunctionObject { DECLARE_HEAP_OBJECT(ScriptFunction, FunctionObject) { DECLARE_MARKOBJECTS(ScriptFunction) enum { - Index_Name = FunctionObject::Index_Prototype + 1, + Index_Name, Index_Length }; void init(QV4::ExecutionContext *scope, Function *function, QV4::String *name = nullptr); @@ -173,7 +172,7 @@ struct Q_QML_EXPORT FunctionObject: Object { void setName(String *name) { defineReadonlyConfigurableProperty(engine()->id_name(), *name); } - void createDefaultPrototypeProperty(uint protoSlot, uint protoConstructorSlot); + void createDefaultPrototypeProperty(uint protoConstructorSlot); inline ReturnedValue callAsConstructor(const JSCallData &data) const; ReturnedValue callAsConstructor(const Value *argv, int argc, const Value *newTarget = nullptr) const { |