diff --git a/test/fixtures/execute/tw-self-restarting-script-keeps-running-until-yield.sb3 b/test/fixtures/execute/tw-self-restarting-script-keeps-running-until-yield.sb3 new file mode 100644 index 00000000000..ee8c61885e0 Binary files /dev/null and b/test/fixtures/execute/tw-self-restarting-script-keeps-running-until-yield.sb3 differ diff --git a/test/snapshot/__snapshots__/tw-self-restarting-script-keeps-running-until-yield.sb3.tw-snapshot b/test/snapshot/__snapshots__/tw-self-restarting-script-keeps-running-until-yield.sb3.tw-snapshot new file mode 100644 index 00000000000..2783ca0147a --- /dev/null +++ b/test/snapshot/__snapshots__/tw-self-restarting-script-keeps-running-until-yield.sb3.tw-snapshot @@ -0,0 +1,38 @@ +// TW Snapshot +// Input SHA-256: dc029abbf128cea0830f4578e89619949837ec26dfa76f110ca599a9ee12e66e + +// Sprite1 script +(function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); +const b0 = runtime.getOpcodeFunction("looks_say"); +const b1 = stage.variables["G{NQ*NXG*qzywe1Q3?FM"]; +const b2 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"]; +return function* genXYZ () { +yield* executeInCompatibilityLayer({"MESSAGE":"plan 1",}, b0, false, false, "c", null); +b1.value = 0; +b2.value = 0; +startHats("event_whenbroadcastreceived", { BROADCAST_OPTION: "message1" }); +retire(); return; +}; }) + +// Sprite1 script +(function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); +const b0 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"]; +const b1 = stage.variables["G{NQ*NXG*qzywe1Q3?FM"]; +const b2 = runtime.getOpcodeFunction("looks_say"); +return function* genXYZ () { +if (compareEqual(b0.value, 0)) { +b0.value = 1; +startHats("event_whenbroadcastreceived", { BROADCAST_OPTION: "message1" }); +b1.value = 1; +for (var a0 = 1; a0 >= 0.5; a0--) { +yield; +} +b1.value = 2; +} else { +if (((+b1.value || 0) === 1)) { +yield* executeInCompatibilityLayer({"MESSAGE":"pass",}, b2, false, false, "p", null); +} +yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b2, false, false, "n", null); +} +retire(); return; +}; }) diff --git a/test/snapshot/__snapshots__/warp-timer/tw-self-restarting-script-keeps-running-until-yield.sb3.tw-snapshot b/test/snapshot/__snapshots__/warp-timer/tw-self-restarting-script-keeps-running-until-yield.sb3.tw-snapshot new file mode 100644 index 00000000000..2783ca0147a --- /dev/null +++ b/test/snapshot/__snapshots__/warp-timer/tw-self-restarting-script-keeps-running-until-yield.sb3.tw-snapshot @@ -0,0 +1,38 @@ +// TW Snapshot +// Input SHA-256: dc029abbf128cea0830f4578e89619949837ec26dfa76f110ca599a9ee12e66e + +// Sprite1 script +(function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); +const b0 = runtime.getOpcodeFunction("looks_say"); +const b1 = stage.variables["G{NQ*NXG*qzywe1Q3?FM"]; +const b2 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"]; +return function* genXYZ () { +yield* executeInCompatibilityLayer({"MESSAGE":"plan 1",}, b0, false, false, "c", null); +b1.value = 0; +b2.value = 0; +startHats("event_whenbroadcastreceived", { BROADCAST_OPTION: "message1" }); +retire(); return; +}; }) + +// Sprite1 script +(function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); +const b0 = stage.variables["`jEk@4|i[#Fk?(8x)AV.-my variable"]; +const b1 = stage.variables["G{NQ*NXG*qzywe1Q3?FM"]; +const b2 = runtime.getOpcodeFunction("looks_say"); +return function* genXYZ () { +if (compareEqual(b0.value, 0)) { +b0.value = 1; +startHats("event_whenbroadcastreceived", { BROADCAST_OPTION: "message1" }); +b1.value = 1; +for (var a0 = 1; a0 >= 0.5; a0--) { +yield; +} +b1.value = 2; +} else { +if (((+b1.value || 0) === 1)) { +yield* executeInCompatibilityLayer({"MESSAGE":"pass",}, b2, false, false, "p", null); +} +yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b2, false, false, "n", null); +} +retire(); return; +}; })