You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior to #150 the use of var to declare a local variable, followed by some type of non-web-element steps (such as echo, api, if), will let the steps be able to access the locally defined variable. For such niche cases, it is working not by design.
After #150, the locally defined variable will not be accessible by those non-web-element steps. This issue is to evaluate whether to enable backward compatibility by auto-making var declarations to be broader in scope. More details here - #150 (comment) and #150 (comment)
The text was updated successfully, but these errors were encountered:
For backward compatibility, it is easy to update TagUI translation engine to always convert var variable_name = xxx to variable_name = xxx but this prevents advanced users who wants to limit scope of a variable within a section of JavaScript code from implementing good programming practices. Thus keep it flexible so that users can write variable_name = xxx according to TagUI documentation, or use var variable_name = xxx if they wish to limit scope for just that few consecutive JS statements.
After weighing and discussing best practices with @Aussiroth and @lohvht, decision is not to auto-remove the use of var. Nothing needs to be done for readme or samples as they already use = directly for declaration.
May consider creating a helper script to auto-process old scripts into new ones for convenience of users. Though not recommended as users should decide rather than being auto-upgraded and may be interpreted incorrectly.
Prior to #150 the use of var to declare a local variable, followed by some type of non-web-element steps (such as echo, api, if), will let the steps be able to access the locally defined variable. For such niche cases, it is working not by design.
After #150, the locally defined variable will not be accessible by those non-web-element steps. This issue is to evaluate whether to enable backward compatibility by auto-making var declarations to be broader in scope. More details here - #150 (comment) and #150 (comment)
The text was updated successfully, but these errors were encountered: