`with-meta` does not work on function objects

Description

`with-meta` does not working on function objects in CLJS. Compilation fails with the following error:

Error: No protocol method IWithMeta.-with-meta defined for type function: function {
return x;
}

I tried it out on the REPL and found the following:

---------- BEGIN: repl-rhino ---------- ClojureScript:cljs.user> (with-meta #(do :foo) {:foo :bar})
"Error evaluating:" (with-meta (fn* [] (do :foo)) {:foo :bar}) :as "cljs.core.with_meta.call(null,(function (){\nreturn \"\\uFDD0'foo\";\n}),cljs.core.ObjMap.fromObject([\"\\uFDD0'foo\"],{\"\\uFDD0'foo\":\"\\uFDD0'bar\"}));\n"
org.mozilla.javascript.JavaScriptException: Error: No protocol method IWithMeta.-with-meta defined for type function:
function () {
return "\ufdd0'foo";
}
(cljs/core.cljs#222)
at cljs/core.cljs:222 (anonymous)
at cljs/core.cljs:214 (_with_meta)
at cljs/core.cljs:806 (with_meta)
at <cljs repl>:2 (anonymous)
at <cljs repl>:2

nil
---------- END: repl-rhino ----------
Reference: https://groups.google.com/forum/?fromgroups=#!topic/clojure/pRO-5IlilNM

Environment

CLJS Rhino-REPL and during Compilation

Status

Assignee

David Nolen

Reporter

import

Labels

None

Approval

None

Patch

Code and Test

Priority

Major