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

Whitespace collapsing is dangerous #16

Open
rutsky opened this issue Feb 10, 2015 · 0 comments
Open

Whitespace collapsing is dangerous #16

rutsky opened this issue Feb 10, 2015 · 0 comments

Comments

@rutsky
Copy link

rutsky commented Feb 10, 2015

When using Dojo declarative syntax for writing methods developer can write inline JavaScript comments, e.g.:

<script type="dojo/method" data-dojo-event="getChildren" data-dojo-args="object">
     // Supply a getChildren() method to store for the data model where
     // children objects point to their parent (aka relational model)
     return this.query({parent: this.getIdentity(object)});
</script>

(full example at http://livedocs.dojotoolkit.org/dijit/Tree-examples#id3 )

When spaces are being collapsed, such multiline code becomes single line of commented code, e.g.

<script [...]> // Supply [...] // children [...] return this.query({parent: this.getIdentity(object)}); </script>

which may lead to runtime errors about undefined variables (since now function doesn't return anything).

Spaces should be collapsed in smarter way taking in account such Dojo features.

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