ClojureScript

apply constructor generates invalid JS

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Trivial Trivial
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    0.0-1913

Description

(apply js/String. "foo")

generates the javscript:

cljs.core.apply.call(null,String.,"foo")

which does not parse. This seems like a bad failure mode.

Activity

David Nolen made changes -
Field Original Value New Value
Priority Minor [ 4 ] Trivial [ 5 ]
Hide
Antonin Hildebrand added a comment -

A note to myself: a possible javascript solution is outlined here:
http://stackoverflow.com/questions/1606797/use-of-apply-with-new-operator-is-this-possible

Show
Antonin Hildebrand added a comment - A note to myself: a possible javascript solution is outlined here: http://stackoverflow.com/questions/1606797/use-of-apply-with-new-operator-is-this-possible
Hide
David Nolen added a comment -

This isn't valid Clojure(Script). Whether we should produce a warning of some kind is a separate issue.

Show
David Nolen added a comment - This isn't valid Clojure(Script). Whether we should produce a warning of some kind is a separate issue.
David Nolen made changes -
Resolution Declined [ 2 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: