aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/language/value.h
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2017-10-04 11:59:05 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2017-10-04 14:11:37 +0000
commit6d568728aceb0beda1545706fe70450333410c86 (patch)
tree8412b3f3a507e105368c72845166fb286a95c03d /src/lib/corelib/language/value.h
parent0b46440f5310018b5e881b03a355953bdb2ea188 (diff)
Fix usage of outer within Properties blocks
In EvaluatorScriptClass we're cloning the value that's referenced by "outer" and leave out the list of alternatives. This custom cloning code was missing the defining item of JSSourceValue, which led to an error if the outer item was dependent on some other property. Now, we create a full clone and clear the necessary members. This ensures we do not have to adjust this code if another member is added to JSSourceValue. Task-number: QBS-1205 Change-Id: I59596894f365fa5207490922ee60959e221102b1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/language/value.h')
-rw-r--r--src/lib/corelib/language/value.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/corelib/language/value.h b/src/lib/corelib/language/value.h
index 6b0c98dc9..f0b4c44a6 100644
--- a/src/lib/corelib/language/value.h
+++ b/src/lib/corelib/language/value.h
@@ -75,12 +75,13 @@ public:
void setNext(const ValuePtr &next);
bool createdByPropertiesBlock() const { return m_createdByPropertiesBlock; }
+ void clearCreatedByPropertiesBlock() { m_createdByPropertiesBlock = false; }
private:
Type m_type;
Item *m_definingItem;
ValuePtr m_next;
- const bool m_createdByPropertiesBlock;
+ bool m_createdByPropertiesBlock;
};
class ValueHandler
@@ -158,6 +159,7 @@ public:
const QList<Alternative> &alternatives() const { return m_alternatives; }
void setAlternatives(const QList<Alternative> &alternatives) { m_alternatives = alternatives; }
void addAlternative(const Alternative &alternative) { m_alternatives.append(alternative); }
+ void clearAlternatives();
void setDefiningItem(Item *item);