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

Don't rely on rule.position existing #6

Open
cw-peter opened this issue Nov 27, 2014 · 0 comments
Open

Don't rely on rule.position existing #6

cw-peter opened this issue Nov 27, 2014 · 0 comments

Comments

@cw-peter
Copy link

In this code:

      rule.media = rule.media.replace(EXTENSION_RE, function(_, name) {
        var replacement = map[name];
        var column = rule.position.start.column;
        var line = rule.position.start.line;
        var source = rule.position.source;

you rely on position being defined, however some plugins mutate the AST and don't add the position property (@rework-pure-grids I'm looking at you...).

This breaks the plugin.

As the line and column are only used in an error message, it should be possible to check for their existence before using them.

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