Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

Using the def form, with the specific metadata ^:field causes the cljs compiler
to prepend "self__" to the output js form.

The browser (latest chrome/firefox) does not recognize "self__".

`

Test Case: Tested against master: 5ac1503

(ns test-def)

(def ^:foo e identity)
e
; test_def.e = cljs.core.identity;
; test_def.e;

(def ^:field f identity)
f
; test_def.f = cljs.core.identity;
; self__.test_def.f;
; Uncaught ReferenceError: self__ is not defined
`

https://gist.github.com/4185793

3 Answers

0 votes
by

Comment made by: bbloom

code tags

0 votes
by

Comment made by: dnolen

This one is a bit annoying. We should probably use namespaced keywords internally.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-434 (reported by andrewmcveigh)
...