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

Add tests for parsing the var() function #1794

Merged
merged 1 commit into from Jun 21, 2022
Merged

Add tests for parsing the var() function #1794

merged 1 commit into from Jun 21, 2022

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Jun 16, 2022

See sass/sass#3245

[skip dart-sass]

Comment on lines +60 to +61
$args: --c, d;
a {b: var($args...)}
Copy link
Member

Choose a reason for hiding this comment

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

If I had

$args: --c, d;
a {b: var($args..., )}

or

$args: --c;
a {b: var($args...,)}

Should those cases pass with a { b: var(--c, d) } and a { b: var(--c, ) } respectively?
or would both be considered errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's actually tested on line 275. They're both valid, but they ignore the comma, because Sass generally allows trailing commas in argument lists, maps, and so on.

Copy link
Member

Choose a reason for hiding this comment

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

I see, I did notice that test but assumed that @function var would make the special handling to work differently, but if both are meant to be similar then this is fine

@nex3 nex3 requested a review from Goodwine June 17, 2022 00:16
Comment on lines +60 to +61
$args: --c, d;
a {b: var($args...)}
Copy link
Member

Choose a reason for hiding this comment

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

I see, I did notice that test but assumed that @function var would make the special handling to work differently, but if both are meant to be similar then this is fine

@nex3 nex3 merged commit 44ef358 into main Jun 21, 2022
@nex3 nex3 deleted the empty-fallback-var branch June 21, 2022 22:07
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.

None yet

2 participants