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

Reserved function names #713

Closed
KittyGiraudel opened this issue Dec 10, 2014 · 2 comments · Fixed by #727
Closed

Reserved function names #713

KittyGiraudel opened this issue Dec 10, 2014 · 2 comments · Fixed by #727

Comments

@KittyGiraudel
Copy link

Sass should throw an error if one tries to create functions called or, and and not. This is an issue I opened in Sass repo a while ago: sass/sass#1265.

Test:

@function and() {
  @return "and";
}

@function or() {
  @return "or";
}

@function not() {
  @return "not";
}

test {
  not: not();
  or: or();
  and: and();
}

Expect:

Invalid function name "and".

Result:

test {
  not: "not";
  or: "or";
  and: "and"; }

Ref: http://sass-compatibility.github.io/#reserved_function_names

@xzyfer
Copy link
Contributor

xzyfer commented Dec 11, 2014

Spec added sass/sass-spec#167

@xzyfer
Copy link
Contributor

xzyfer commented Dec 11, 2014

This behaviour changed in Sass 3.3.9 - http://sass-lang.com/documentation/file.SASS_CHANGELOG.html#339_27_june_2014

Defining a function named “and”, “or”, or “not” is now an error at definition-time. This isn’t considered a backwards-incompatible change because although these functions could be defined previously, they could never be successfully invoked.

saper pushed a commit to saper/sass-spec that referenced this issue Sep 20, 2015
saper pushed a commit to saper/sass-spec that referenced this issue Sep 21, 2015
saper pushed a commit to saper/sass-spec that referenced this issue Sep 21, 2015
saper pushed a commit to saper/sass-spec that referenced this issue Sep 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants