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
HugoGiraudel opened this Issue Dec 10, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@HugoGiraudel

HugoGiraudel commented Dec 10, 2014

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

This comment has been minimized.

Contributor

xzyfer commented Dec 11, 2014

Spec added sass/sass-spec#167

@xzyfer

This comment has been minimized.

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.

@xzyfer xzyfer closed this in #727 Dec 12, 2014

saper added a commit to saper/sass-spec that referenced this issue Sep 20, 2015

saper added a commit to saper/sass-spec that referenced this issue Sep 21, 2015

saper added a commit to saper/sass-spec that referenced this issue Sep 21, 2015

saper added 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