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

Alternative to with(obj||{}) #14

Open
sekoyo opened this issue Jan 28, 2014 · 0 comments
Open

Alternative to with(obj||{}) #14

sekoyo opened this issue Jan 28, 2014 · 0 comments

Comments

@sekoyo
Copy link

sekoyo commented Jan 28, 2014

Hi,

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with
"Using with is not recommended, and is forbidden in ECMAScript 5 strict mode."

I was wondering if there is a way to avoid using with as my closure compiler makes 270 verbose warnings about it and it fails in strict mode. Also the lookups needed make the execution slower.

Is there any 'automagic' way of appending the context variable to the references in the template or do you think the only way around this is to manually append a 'special' variable like ctx when referencing variables from the view in the template?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant