We're updating the issue view to help you get more done. 

Self-host: Allow :file key in cljs.js/*load-fn* callback

Description

Bootstrapped ClojureScript is abstracted away from direct I/O by use of a load-fn callback. A result is that when a namespace is loaded, the :file attribute associated with def s in [:cljs.analyzer/namespaces 'foo.ns :defs] in the AST is nil, because cljs.analyzer/cljs-file cannot be set to a meaningful value.

This ticket asks for an extension to load-fn, allowing a :file key to be optionally included by cljs.js clients, and for cljs.analyzer/cljs-file to be bound to that value in appropriate places in cljs.js so that the :file info appears in the AST.

One rationale for this :file attribute is that it makes it easier for clients of cljs.js to look up the file for a def, say, for use when implementing a source REPL special, for example.

Environment

None

Status

Assignee

David Nolen

Reporter

Mike Fikes

Labels

Approval

None

Patch

Code and Test

Affects versions

1.7.145

Priority

Minor