File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 14361436 (warning :single-segment-namespace env {:name name}))
14371437 (when (some js-reserved segments)
14381438 (warning :munged-namespace env {:name name}))
1439- (find-def-clash env name segments))
1439+ (find-def-clash env name segments)
1440+ (when (some (complement util/valid-js-id-start?) segments)
1441+ (throw (AssertionError.
1442+ (str " Namespace " name " has a segment starting with an invaild "
1443+ " JavaScript identifier" )))))
14401444 (let [docstring (if (string? (first args)) (first args))
14411445 mdocstr (-> name meta :doc )
14421446 args (if docstring (next args) args)
Original file line number Diff line number Diff line change 126126 (when (= depth 0 )
127127 (distinct (apply concat (vals @state)))))))
128128
129+ (defn valid-js-id-start? [s]
130+ (re-find #"(?U)^[\p {Alpha}_$]" s))
131+
129132(defn debug-prn
130133 [& args]
131134 (binding [*out* *err*]
You can’t perform that action at this time.
0 commit comments