-
• #2
Thanks! In Espruino,
of
is a reserved word because offor (var i of foo)
so I'm surprised it's actually not in the JS spec.I'd been having issues with the Layout.js file when pretokenised, so it's actually possible you're having the same issue. I just filed a bug for this so I can track it https://github.com/espruino/Espruino/issues/2047
This particular one should be an easy fix (changing the pretokeniser to ignore 'of') but there are definitely other cases like this where it could be a problem.
-
• #3
Turns out the pretokeniser issue is unrelated, so this issue is very specifically just if you decide to call a function
of
.
Mon 2021.09.06
During development, attempted to create shortened two letter function names that maintained alignment.
Significantly shortened statement:
Throws error:
There is no immediate rush to resolve this for me as I've created a temporary workaround. More curious as to what is causing this.
of
is not a reserved word:However, I did find a reference used within a for loop:
I'm making the assumption that 'of' might be parsed as part of the statement syntax in this case, but really doesn't answer why a function may not have the same name as it isn't a reserved keyword.