Uploaded image for project: 'ClojureScript'
  1. CLJS-1504

Self-host: Pseudo-namespace for macro namespace analysis metadata

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects versions: 1.7.145
    • Fix versions: None
    • Labels:

      Description

      Background: A pseudo-name is used for macro namespaces (involving a "$macros" suffix, codified in cljs.analyzer/macro-ns-name).

      There is a line that conditionally converts to this pseudo-name when a macro namespace is being required:

      https://github.com/clojure/clojurescript/blob/r1.7.189/src/main/cljs/cljs/js.cljs#L220

      But, that line has a simple typo: The keyword should be :macros-ns See its proper use a few lines down here:

      https://github.com/clojure/clojurescript/blob/r1.7.189/src/main/cljs/cljs/js.cljs#L226

      Simply correcting this typo is alone insufficient because the undecorated name is expected in places, such as the ns->relpath on this line:

      https://github.com/clojure/clojurescript/blob/r1.7.189/src/main/cljs/cljs/js.cljs#L233

      But, by introducing another symbol to hold the pseudo-name for use in the state when used in [::ana/namespaces ns] constructs, analysis metadata for macro namespaces is properly placed in the state, and things like the caching feature begins to work correctly for macro namespaces, and probably other behavior that depends on this becomes correct (perhaps reloading, etc.)

        Attachments

          Activity

            People

            • Assignee:
              mfikes Mike Fikes
              Reporter:
              mfikes Mike Fikes
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: