Page 1 of 1

Cool feature we have just discovered

Posted: Tue Apr 18, 2017 2:59 pm
by Stokes
This is a fun test to run in a workspace. I doubt this is actually a problem for anyone but it does seem strange you can overwrite Classes and Jade Constants within a method.

Code: Select all

constants Object = "Why?"; CrLf = "Not sure"; vars begin write Object; write CrLf; end;

Re: Cool feature we have just discovered

Posted: Wed Apr 19, 2017 7:42 am
by allistar
It is odd that Jade allows this. It's to do with scope and is why you can have a local variable with the same name as a member property. I implemented a shift-reduce parser for Jade (in Jade) and this "feature" threw me for a bit. I don't know why anyone would take advantage of it other than to confuse other developers :-)