Skip to content

Commit

Permalink
Rename CSSFunction function property to f
Browse files Browse the repository at this point in the history
Newer version of the Closure compiler warn about naming a property
`function`. The CSSFunction defrecord has a field called `function`.
This commit renames it to `f` to avoid these compiler warnings.

This is a breaking change if anyone was relying on that field.

Fixes noprompt#144
  • Loading branch information
danielcompton committed Feb 19, 2018
1 parent 4eda64f commit e3c5dc9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.3.1

**Breaking Change:** The `function` field in `CSSFunction` has been renamed to avoid Closure Compiler warnings. [#144](https://github.com/noprompt/garden/issues/144)

## Changes from 1.3.0

Migrate cljx to cljc and maintain parity with Clojure/Cljs with 1.7. For
Expand Down
4 changes: 2 additions & 2 deletions src/garden/compiler.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,11 @@
(defn- render-function
"Render a CSS function."
[css-function]
(let [{:keys [function args]} css-function
(let [{:keys [f args]} css-function
args (if (sequential? args)
(comma-separated-list args)
(util/to-str args))]
(util/format "%s(%s)" (util/to-str function) args)))
(util/format "%s(%s)" (util/to-str f) args)))

(defn ^:private render-color [c]
(if-let [a (:alpha c)]
Expand Down
2 changes: 1 addition & 1 deletion src/garden/types.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

(defrecord CSSUnit [unit magnitude])

(defrecord CSSFunction [function args])
(defrecord CSSFunction [f args])

(defrecord CSSAtRule [identifier value])

0 comments on commit e3c5dc9

Please sign in to comment.