Sorry, I thought it was the well known issue. Here is the simplified macro:
(defmacro custom-this []
(list 'js* "this")
)
(defmacro test-comp
[tsym tfields bsym & impls]
`(defn ~tsym [~@tfields]
~@(map (fn[c]
`(this-as this#
(aset this# ~(str c) ~c))) tfields)
~(if (symbol? (first impls))
`(goog/base (custom-this))
(let [[constr-name params & bd] (first impls)
mta (meta constr-name)
ovrrd (when mta (= 'override (:tag mta)))
thsym (gensym "this")
]
`(this-as ~thsym
~(when-not ovrrd
;`(goog/base ~thsym ~@params)
`(goog/base (custom-this) ~@params)
)
~@bd)))
(this-as this## this##)
)
)
and the test case in the cljs file:
(mm/test-comp TestComponent [name] goog.ui.Component)
generates the following js code:
testns.TestComponent = (function testns$TestComponent(name){
var this__18400__auto___26494 = this;
(this__18400__auto___26494["name"] = name);
var this26491_26495 = this;
var G__26493_26496 = this;
goog.base(G__26493_26496);
var this_SHARP___18401__auto__ = this;
return this_SHARP___18401__auto__;
});
and that fails during the advanced compilation phase with:
ERROR: JSC_BASE_CLASS_ERROR. incorrect use of goog.base: First argument must be
'this'.
Thanks,
Dusan
--
Note that posts from new members are moderated - please be patient with your
first post.
---
You received this message because you are subscribed to the Google Groups
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.