is compiled? shouldn't return true if compiler is explicitly disabled

This commit is contained in:
Thomas Weber committed 2020-11-18 17:43:25 -06:00
1 parent 60afe75aa8
commit 084418bbe5
1 file changed
+5 -2
+5 -2
View File
@@ -75,8 +75,11 @@ class Scratch3ProcedureBlocks {
// tw: is compiled? and is turbowarp? should return true
// Yes, is compiled? is returning a technically incorrect value.
// This results in the least astonishment for users when they click on "is compiled?" on its own.
if (`${args.VALUE}`.toLowerCase() === 'is compiled?' || `${args.VALUE}`.toLowerCase() === 'is turbowarp?') {
return true;
if (util.target.runtime.compilerOptions.enabled) {
const lowercaseValue = `${args.VALUE}`.toLowerCase();
if (lowercaseValue === 'is compiled?' || lowercaseValue === 'is turbowarp?') {
return true;
}
}
// When the parameter is not found in the most recent procedure
// call, the default is always 0.