forked from scratchfoundation/scratch-vm
-
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't eagerly cast boolean arguments to boolean
Fixes #222
- Loading branch information
1 parent
99ff662
commit fcee94f
Showing
5 changed files
with
52 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
24 changes: 24 additions & 0 deletions
24
test/snapshot/__snapshots__/tw-boolean-arguments-are-not-cast.sb3.tw-snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// TW Snapshot | ||
// Input SHA-256: b157139c7d41cd5d9bc1829c714121545a8e42ea64c094db8081d9741b032be0 | ||
|
||
// Sprite1 script | ||
(function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); | ||
const b0 = runtime.getOpcodeFunction("looks_say"); | ||
return function* genXYZ () { | ||
yield* executeInCompatibilityLayer({"MESSAGE":"plan 1",}, b0, false, false, "f", null); | ||
yield* thread.procedures["ZBlock A %s"]("Hai!!!"); | ||
yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "k", null); | ||
retire(); return; | ||
}; }) | ||
|
||
// Sprite1 ZBlock A %s | ||
(function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); | ||
const b0 = runtime.getOpcodeFunction("looks_say"); | ||
return function* genXYZ_Block_A_ (p0) { | ||
if ((("" + p0).toLowerCase() === "Hai!!!".toLowerCase())) { | ||
yield* executeInCompatibilityLayer({"MESSAGE":"pass did not cast",}, b0, false, false, "m", null); | ||
} else { | ||
yield* executeInCompatibilityLayer({"MESSAGE":"fail was casted",}, b0, false, false, "n", null); | ||
} | ||
return ""; | ||
}; }) |
24 changes: 24 additions & 0 deletions
24
test/snapshot/__snapshots__/warp-timer/tw-boolean-arguments-are-not-cast.sb3.tw-snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// TW Snapshot | ||
// Input SHA-256: b157139c7d41cd5d9bc1829c714121545a8e42ea64c094db8081d9741b032be0 | ||
|
||
// Sprite1 script | ||
(function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); | ||
const b0 = runtime.getOpcodeFunction("looks_say"); | ||
return function* genXYZ () { | ||
yield* executeInCompatibilityLayer({"MESSAGE":"plan 1",}, b0, false, false, "f", null); | ||
yield* thread.procedures["ZBlock A %s"]("Hai!!!"); | ||
yield* executeInCompatibilityLayer({"MESSAGE":"end",}, b0, false, false, "k", null); | ||
retire(); return; | ||
}; }) | ||
|
||
// Sprite1 ZBlock A %s | ||
(function factoryXYZ(thread) { const target = thread.target; const runtime = target.runtime; const stage = runtime.getTargetForStage(); | ||
const b0 = runtime.getOpcodeFunction("looks_say"); | ||
return function* genXYZ_Block_A_ (p0) { | ||
if ((("" + p0).toLowerCase() === "Hai!!!".toLowerCase())) { | ||
yield* executeInCompatibilityLayer({"MESSAGE":"pass did not cast",}, b0, false, false, "m", null); | ||
} else { | ||
yield* executeInCompatibilityLayer({"MESSAGE":"fail was casted",}, b0, false, false, "n", null); | ||
} | ||
return ""; | ||
}; }) |