             (str ret
               (.substring munged-name last-match-end
                 (- (. r -lastIndex) (. x -length)))
-              (if (= x "$") "/" (gobject/get DEMUNGE_MAP x)))
+              (if (identical? x "$") "/" (gobject/get DEMUNGE_MAP x)))
             (. r -lastIndex)))
         (str ret
           (.substring munged-name last-match-end (.-length munged-name)))))))

(defn demunge [name]
  ((if (symbol? name) symbol str)
    (let [name' (str name)]
      (if (= name' "_DOT__DOT_")
        ".."
        (demunge-str (str name))))))


    (.toString sb)))

(defn munge [name]
  (let [name' (munge-str (str name))
        name' (cond
                (identical? name' "..") "_DOT__DOT_"
                (js-reserved? name') (str name' "$")
                :else name')]
    (if (symbol? name)
      (symbol name')
      (str name'))))

(defn- demunge-str [munged-name]
  (let [r (js/RegExp. (demunge-pattern) "g")
