File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 229229 (goog/isString x))
230230
231231(defn ^boolean char?
232- " Returns true if x is a JavaScript char ."
232+ " Returns true if x is a JavaScript string of length one ."
233233 [x]
234- (gstring/isUnicodeChar x ))
234+ (and ( string? x) ( == 1 ( .-length x)) ))
235235
236236(defn ^boolean any?
237237 " Returns true if given any argument."
Original file line number Diff line number Diff line change 648648 (throw (error ~env (.getMessage err#) err#)))))))
649649
650650; ; namespaces implicit to the inclusion of cljs.core
651- (def implicit-nses '#{goog goog.object goog.string goog.array Math})
651+ (def implicit-nses '#{goog goog.object goog.string goog.array Math String })
652652
653653(defn implicit-import?
654654 #? (:cljs {:tag boolean})
Original file line number Diff line number Diff line change 950950 (is (= 1 (do #js {:a 1 }
951951 1 )))
952952 (is (= 1 (aget #js {:a 1 } " a" )))
953- (is (= 1 (.-a #js {:a 1 })))))
953+ (is (= 1 (.-a #js {:a 1 })))))
954+
955+ (deftest test-char?
956+ (is (char? " 0" ))
957+ (is (char? (String/fromCharCode 13 )))
958+ (is (char? (String/fromCharCode 10 )))
959+ (is (char? \newline))
960+ (is (char? \space))
961+ (is (char? " 0" ))
962+ (is (char? " \u 0080" ))
963+ (is (char? " \u FFFD" )))
You can’t perform that action at this time.
0 commit comments