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 1436
1436
(warning :single-segment-namespace env {:name name}))
1437
1437
(when (some js-reserved segments)
1438
1438
(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" )))))
1440
1444
(let [docstring (if (string? (first args)) (first args))
1441
1445
mdocstr (-> name meta :doc )
1442
1446
args (if docstring (next args) args)
Original file line number Diff line number Diff line change 126
126
(when (= depth 0 )
127
127
(distinct (apply concat (vals @state)))))))
128
128
129
+ (defn valid-js-id-start? [s]
130
+ (re-find #"(?U)^[\p {Alpha}_$]" s))
131
+
129
132
(defn debug-prn
130
133
[& args]
131
134
(binding [*out* *err*]
You can’t perform that action at this time.
0 commit comments