From 9f8f79758aa3dca0568c3f9e432712fddcdf592d Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Mon, 13 Dec 2021 18:37:44 -0800 Subject: [PATCH] switch to step attribute --- src/Xref.ts | 16 ++++++++-------- .../generated-reference/effect-user-code.html | 2 +- test/baselines/sources/effect-user-code.html | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Xref.ts b/src/Xref.ts index 1aa63405..7ed3880d 100644 --- a/src/Xref.ts +++ b/src/Xref.ts @@ -111,14 +111,14 @@ export default class Xref extends Builder { return false; } - if (parent.children[0]) { - const child = parent.children[0]; - if ( - child.tagName === 'EMU-META' && - child.getAttribute('fence-effects')?.includes(effectName) - ) { - return false; - } + if ( + parent + .getAttribute('fence-effects') + ?.split(',') + .map(s => s.trim()) + .includes(effectName) + ) { + return false; } } if (!this.clause.canHaveEffect(effectName)) { diff --git a/test/baselines/generated-reference/effect-user-code.html b/test/baselines/generated-reference/effect-user-code.html index b406e60d..16204416 100644 --- a/test/baselines/generated-reference/effect-user-code.html +++ b/test/baselines/generated-reference/effect-user-code.html @@ -125,7 +125,7 @@

20 ResultOfEvaluating()

21 FencedEffects()

The abstract operation FencedEffects takes no arguments. Effects don't propagate past fences in parent steps. A fence must be at the beginning of a step. It performs the following steps when called:

-
  1. Fence.
    1. UserCode().
+
  1. Fence.
    1. UserCode().
diff --git a/test/baselines/sources/effect-user-code.html b/test/baselines/sources/effect-user-code.html index 273c30da..ffcd5322 100644 --- a/test/baselines/sources/effect-user-code.html +++ b/test/baselines/sources/effect-user-code.html @@ -229,7 +229,7 @@

FencedEffects()

Effects don't propagate past fences in parent steps. A fence must be at the beginning of a step.
- 1. Fence. + 1. [fence-effects="user-code"] Fence. 1. UserCode().