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

Calling walk on a DeclarationList with visit: Declaration doesn't work #114

Closed
fstanis opened this issue Dec 5, 2019 · 2 comments
Closed

Comments

@fstanis
Copy link

fstanis commented Dec 5, 2019

I'm not sure if this is a bug or I'm doing something wrong, but this doesn't seem to work:

const csstree = require('css-tree');
const ast = csstree.parse('color: red; background-color: blue', { context: 'declarationList' });
csstree.walk(ast, {
  visit: 'Declaration',
  enter: function(node) {
    console.log(node);
  }
});

csstree.walk(ast, function(node) { console.log(node) }) however works fine; also, visit: 'Identifier' and anything other than visit: 'Declaration' seems to also work as expected.

Any thoughts?

@lahmatiy
Copy link
Member

lahmatiy commented Dec 5, 2019

That's a bug. Fix is coming!

@lahmatiy
Copy link
Member

lahmatiy commented Dec 5, 2019

Fixed in 1.0.0-alpha.39

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

No branches or pull requests

2 participants