Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

Gracefully handle empty custom properties #63

Open
nex3 opened this issue May 31, 2018 · 0 comments
Open

Gracefully handle empty custom properties #63

nex3 opened this issue May 31, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@nex3
Copy link
Contributor

nex3 commented May 31, 2018

Empty custom properties like --foo:; should produce syntax errors, but currently Ruby Sass throws:

/home/nweiz/code/sass/lib/sass/util.rb:159:in `merge_adjacent_strings': undefined method `size' for nil:NilClass (NoMethodError)
        from /home/nweiz/code/sass/lib/sass/tree/prop_node.rb:73:in `initialize'
        from /home/nweiz/code/sass/lib/sass/scss/parser.rb:837:in `new'
        from /home/nweiz/code/sass/lib/sass/scss/parser.rb:837:in `css_variable_declaration'
        from /home/nweiz/code/sass/lib/sass/scss/parser.rb:785:in `try_declaration'
        from /home/nweiz/code/sass/lib/sass/scss/parser.rb:732:in `declaration_or_ruleset'
        from /home/nweiz/code/sass/lib/sass/scss/parser.rb:697:in `block_child'
        from /home/nweiz/code/sass/lib/sass/scss/parser.rb:686:in `block_contents'
        from /home/nweiz/code/sass/lib/sass/scss/parser.rb:678:in `block'
        from /home/nweiz/code/sass/lib/sass/scss/parser.rb:670:in `ruleset'
        from /home/nweiz/code/sass/lib/sass/scss/parser.rb:696:in `block_child'
        from /home/nweiz/code/sass/lib/sass/scss/parser.rb:686:in `block_contents'
        from /home/nweiz/code/sass/lib/sass/scss/parser.rb:137:in `stylesheet'
        from /home/nweiz/code/sass/lib/sass/scss/parser.rb:41:in `parse'
        from /home/nweiz/code/sass/lib/sass/engine.rb:414:in `_to_tree'
        from /home/nweiz/code/sass/lib/sass/engine.rb:290:in `render'
        from /home/nweiz/code/sass/lib/sass/exec/sass_scss.rb:400:in `run'
        from /home/nweiz/code/sass/lib/sass/exec/sass_scss.rb:63:in `process_result'
        from /home/nweiz/code/sass/lib/sass/exec/base.rb:52:in `parse'
        from /home/nweiz/code/sass/lib/sass/exec/base.rb:19:in `parse!'
        from /home/nweiz/code/sass/bin/sass:13:in `<main>'

Also, empty interpolated custom properties like --foo:#{""} should throw an error but Ruby Sass currently emits them as-is.

See sass/sass-spec#1249 and sass/sass-spec#1259

@nex3 nex3 added the bug Something isn't working label May 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant