jspsych 8.0.3 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,7 +53,7 @@ var jsPsychModule = (function (exports) {
53
53
 
54
54
  var _package = {
55
55
  name: "jspsych",
56
- version: "8.0.3",
56
+ version: "8.1.0",
57
57
  description: "Behavioral experiments in a browser",
58
58
  type: "module",
59
59
  main: "dist/index.cjs",
@@ -2574,7 +2574,8 @@ var jsPsychModule = (function (exports) {
2574
2574
  }
2575
2575
  for (const timelineVariableIndex of timelineVariableOrder) {
2576
2576
  this.setCurrentTimelineVariablesByIndex(timelineVariableIndex);
2577
- for (const childNode of this.instantiateChildNodes()) {
2577
+ for (const childNodeDescription of this.description.timeline) {
2578
+ const childNode = this.instantiateChildNode(childNodeDescription);
2578
2579
  const previousChild = this.currentChild;
2579
2580
  this.currentChild = childNode;
2580
2581
  childNode.index = previousChild ? previousChild.getLatestNode().index + 1 : this.index;
@@ -2632,12 +2633,10 @@ var jsPsychModule = (function (exports) {
2632
2633
  }
2633
2634
  }
2634
2635
  }
2635
- instantiateChildNodes() {
2636
- const newChildNodes = this.description.timeline.map((childDescription) => {
2637
- return isTimelineDescription(childDescription) ? new Timeline(this.dependencies, childDescription, this) : new Trial(this.dependencies, childDescription, this);
2638
- });
2639
- this.children.push(...newChildNodes);
2640
- return newChildNodes;
2636
+ instantiateChildNode(childDescription) {
2637
+ const newChildNode = isTimelineDescription(childDescription) ? new Timeline(this.dependencies, childDescription, this) : new Trial(this.dependencies, childDescription, this);
2638
+ this.children.push(newChildNode);
2639
+ return newChildNode;
2641
2640
  }
2642
2641
  currentTimelineVariables;
2643
2642
  setCurrentTimelineVariablesByIndex(index) {
@@ -3100,4 +3099,4 @@ var jsPsychModule = (function (exports) {
3100
3099
 
3101
3100
  })({});
3102
3101
  var initJsPsych = jsPsychModule.initJsPsych;
3103
- //# sourceMappingURL=https://unpkg.com/jspsych@8.0.3/dist/index.browser.js.map
3102
+ //# sourceMappingURL=https://unpkg.com/jspsych@8.1.0/dist/index.browser.js.map