Skip to content

Whitespace collapsing is dangerous #16

Open
@rutsky

Description

@rutsky

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions