Skip to content

Commit f525d97

Browse files
mfikesswannodette
authored andcommitted
CLJS-1532: Mismatch between instance? params and docstring
- Rename params to match those used in docstring (matching Clojure). - Also, for consistency use same param namings in macro.
1 parent b766dae commit f525d97

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,8 +904,8 @@
904904
(defn ^boolean instance?
905905
"Evaluates x and tests if it is an instance of the type
906906
c. Returns true or false"
907-
[t o]
908-
(cljs.core/instance? t o))
907+
[c x]
908+
(cljs.core/instance? c x))
909909

910910
(defn ^boolean symbol?
911911
"Return true if x is a Symbol"

src/main/clojure/cljs/core.cljc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -921,14 +921,14 @@
921921
(core/defmacro identical? [a b]
922922
(bool-expr (core/list 'js* "(~{} === ~{})" a b)))
923923

924-
(core/defmacro instance? [t o]
924+
(core/defmacro instance? [c x]
925925
;; Google Closure warns about some references to RegExp, so
926926
;; (instance? RegExp ...) needs to be inlined, but the expansion
927927
;; should preserve the order of argument evaluation.
928-
(bool-expr (if (clojure.core/symbol? t)
929-
(core/list 'js* "(~{} instanceof ~{})" o t)
930-
`(let [t# ~t o# ~o]
931-
(~'js* "(~{} instanceof ~{})" o# t#)))))
928+
(bool-expr (if (clojure.core/symbol? c)
929+
(core/list 'js* "(~{} instanceof ~{})" x c)
930+
`(let [c# ~c x# ~x]
931+
(~'js* "(~{} instanceof ~{})" x# c#)))))
932932

933933
(core/defmacro number? [x]
934934
(bool-expr (core/list 'js* "typeof ~{} === 'number'" x)))

0 commit comments

Comments
 (0)