Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit whether to remove specific var backward compatibility for #150 #166

Closed
kensoh opened this issue May 20, 2018 · 2 comments
Closed
Labels

Comments

@kensoh
Copy link
Member

kensoh commented May 20, 2018

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)

@kensoh kensoh added the query label May 20, 2018
@kensoh
Copy link
Member Author

kensoh commented May 20, 2018

Previous notes -

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.

@kensoh
Copy link
Member Author

kensoh commented May 23, 2018

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.

@kensoh kensoh closed this as completed May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant