Skip to content

Conversation

@iamvdo
Copy link
Contributor

@iamvdo iamvdo commented Feb 12, 2015

(fix #21 when parent is undefined)

(fix postcss#21 when `parent` is undefined)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this weird "clone but not really" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found out that atRule.removeSelf() changes the rule previously stored in ignoredAtRules. So I chose to clone node before storing it. I also cloned parent property because the clone() method doesn't make it.
Do you think of another way to do it ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know (or remember) why we do need a parent ref, but anyway, this is fixing a bug, with a test, so merging ^^

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Can you release a patch ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am working a more stable release, but encountering too many weird behavior. This postcss API is starting to break my balls.

I will release a patch asap.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK ;)

MoOx added a commit that referenced this pull request Feb 13, 2015
Properly clone nodes in `ignoredAtRules`
@MoOx MoOx merged commit 27db4b2 into postcss:master Feb 13, 2015
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

Successfully merging this pull request may close these issues.

TypeError when using @import for local and remote stylesheets

2 participants