From 4fc5a9511a514026c543ac727fbd4c7a465795ba Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Tue, 10 Oct 2023 14:36:50 -0700 Subject: [PATCH] Code review --- spec/at-rules/function.md | 2 +- spec/built-in-modules/meta.md | 16 ++++++++++++++++ spec/types/functions.md | 4 ++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/spec/at-rules/function.md b/spec/at-rules/function.md index aa3fd5c6..c62189ed 100644 --- a/spec/at-rules/function.md +++ b/spec/at-rules/function.md @@ -55,7 +55,7 @@ To execute a `@function` rule `rule`: > This overrides the previous definition, if one exists. - * Set [the current import context][]'s function `name` to `function`. + * Set [the current import context]'s function `name` to `function`. > This happens regardless of whether or not it begins with `-` or `_`. diff --git a/spec/built-in-modules/meta.md b/spec/built-in-modules/meta.md index 57af84c0..4b488b6d 100644 --- a/spec/built-in-modules/meta.md +++ b/spec/built-in-modules/meta.md @@ -108,6 +108,10 @@ This function is also available as a global function named `function-exists()`. * If `$name` is not a string, throw an error. +* If `$name` is not an [``], return false. + + [``]: https://drafts.csswg.org/css-syntax-3/#ident-token-diagram + * If `$module` is null: * Return whether [resolving a function][] named `$name` returns null. @@ -135,6 +139,8 @@ This function is also available as a global function named `get-function()`. * If `$name` is not a string, throw an error. +* If `$name` is not an [``], throw an error. + * If `$module` is null: * If `$css` is falsey: @@ -170,6 +176,8 @@ get-mixin($name, $module: null) * If `$name` is not a string, throw an error. +* If `$name` is not an [``], throw an error. + * If `$module` is null: * Return the result of [resolving a mixin] named `$name`. If this returns @@ -197,6 +205,10 @@ This function is also available as a global function named `global-variable-exis * If `$name` is not a string, throw an error. +* If `$name` is not a [`PlainVariable`], return false. + + [`PlainVariable`]: ../variables.md#syntax + * If `$module` is null: * Return whether [resolving a variable][] named `$name`, ignoring local @@ -239,6 +251,8 @@ This function is also available as a global function named `mixin-exists()`. * If `$name` is not a string, throw an error. +* If `$name` is not an [``], return false. + * If `$module` is null: * Return whether [resolving a mixin] named `$name` returns null. @@ -333,6 +347,8 @@ This function is also available as a global function named `variable-exists()`. * If `$name` is not a string, throw an error. +* If `$name` is not a [`PlainVariable`], return false. + * If `$module` is null: * Return whether [resolving a variable][] named `$name` returns null. diff --git a/spec/types/functions.md b/spec/types/functions.md index 0d6c842e..0f0ba467 100644 --- a/spec/types/functions.md +++ b/spec/types/functions.md @@ -43,11 +43,11 @@ refer to the exact same instance of the same procedure. > > $a: meta.get-function(foo); > -> @mixin foo { +> @function foo { > @return red; > } > -> $b: meta.get-mixin(foo); +> $b: meta.get-function(foo); > ``` > > Although every aspect of the two functions is the same, `$a != $b`, because