Skip to content
Snippets Groups Projects
Commit 513c4e7d authored by Emma Söderberg's avatar Emma Söderberg
Browse files

Updates code generation for incremental/region and incremental/param.

- Adds enter/exit construction for List constructor.
- Adds handler check to setChild for region to prevent duplicate notificaiton on the same handler.
- Adds check of computed OR created to handler when reacting to dependency change.
parent 6184e059
No related branches found
No related tags found
No related merge requests found
...@@ -78,10 +78,12 @@ OptDecl.constructor = [[ ...@@ -78,10 +78,12 @@ OptDecl.constructor = [[
# A list constructor that builds a list with all arguments # A list constructor that builds a list with all arguments
ListDecl.constructor = [[ ListDecl.constructor = [[
public $List.$List(T... initialChildren) { public $List.$List(T... initialChildren) {
$include(State.incHookConstructionStart)
children = new $ASTNode[initialChildren.length]; children = new $ASTNode[initialChildren.length];
for (int i = 0; i < children.length; ++i) { for (int i = 0; i < children.length; ++i) {
addChild(initialChildren[i]); addChild(initialChildren[i]);
} }
$include(State.incHookConstructionEnd)
} }
]] ]]
...@@ -116,7 +116,7 @@ if (!state().IN_CONSTRUCTION && !(state().IN_COMPUTATION > 0)) { ...@@ -116,7 +116,7 @@ if (!state().IN_CONSTRUCTION && !(state().IN_COMPUTATION > 0)) {
if (h != null) { if (h != null) {
h.notifyDependencies(); h.notifyDependencies();
} }
if (i == numChildren) { if (i == numChildren && h != handler()) {
handler().notifyDependencies(); handler().notifyDependencies();
} }
$endif $endif
......
...@@ -242,7 +242,7 @@ $endif ...@@ -242,7 +242,7 @@ $endif
// React to change // React to change
public void dependencyChanged() { public void dependencyChanged() {
if (isComputed()) { if (isComputed() || isCreated()) {
setEmpty(); setEmpty();
$if (IncrementalTrack) $if (IncrementalTrack)
trackedFlushes++; trackedFlushes++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment