Overly aggressive removal of call

Description

With https://github.com/clojure/clojurescript/commit/8f38049d543b04b8da55029f140b6577e3ec245a in a situation illustrated below, code gen that previously involved .call has been optimized to avoid .call.

Note elem(attr,kids) in the following:

The previous commit that causes code gen with elem.call(null,attr,kids):

In the downstream Hoplon [1] target test environment, this appears to have differing semantics at runtime, with the elision of .call resulting in an error

[1] https://github.com/hoplon/hoplon/blob/4669838feaeae578ef51bd6d6499104c0bab2cc3/src/hoplon/svg.cljs#L26

Environment

None

Activity

Show:
Mike Fikes
August 12, 2019, 12:28 AM

Adding a bit of diagnostic code in Hoplon surrounding elem to print out what you get if you apply js-keys to it, and you will see that the SVGElement has call (as well as other fields associated with ClojureScript).

I suspect this is the result of Hoplon extending js/Element for its purposes [1], and this is why you can actually invoke it.

[1] https://github.com/hoplon/hoplon/blob/1e73edf7c6e56a4c17a0830cb7f3433cdb039c26/src/hoplon/core.cljs#L460

Mike Fikes
August 12, 2019, 12:40 AM

Given the above, a minimal repro of the issue:

Now broken:

Previously summoned Lurch:

Assignee

Unassigned

Reporter

Mike Fikes

Labels

None

Approval

None

Patch

None

Priority

Major
Configure