#Nested JS function doesn't seem to work
19 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
Paste version of MekPaintingCompat.js from @humble bison
@shell kiln Here's the support ticket. Thank you so much for the help ❤️
Nested functions should work
If i remember correctly a ?? b is currently broken in some way - I don't know what exactly the issue was, but try logging the variables you are assigning with that
it really shouldn't stop code execution though
Though things to note I noticed:
- what PigTurtle mentioned - nullish coalescing operator
??doesn't work properly - Use lowercase types for
string,numberetc. in jsdoc, uppercase refers to wrapper objects but TS changes them to primitives anyway
for (const color of COLORS) {
Change this to
for (let color of COLORS) {
Since const in for-of loop is also broken
I've just gone and changed all of those thing, inclusing const to let. It's still only printing Hiiiiiii not Ohhhhhhh
and there is no error in the log?
No, no error in the log
After much trial and error I have found the culprit: it wasn't the nested function not working, rather
"somestring".replaceAll(A, B);
crashes the JS engine silently. Whereas
"somestring".replace(A, B);
works just fine! Yeah...
... yet another illogical rhino bug
at least you can still use regex to replace all occurences with the string.replace method
crashes the JS engine silently