ClojureScript

no method may be called on number literals

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Duplicate
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    http://himera.herokuapp.com/index.html
    Chromium 32.0.1700.77 (244343)
    Linux hostname 3.12.7-2-ARCH #1 SMP PREEMPT Sun Jan 12 13:09:09 CET 2014 x86_64 GNU/Linux

Description

Himera REPL v0.1.5
cljs.user> (.toString 1)
Compilation error: SyntaxError: Unexpected token ILLEGAL

The problem is that it compiles down to

1.toString()

and the parser interprets "1." as a literal float, followed by junk. This can be fixed with parenthesis around the literal:

(1).toString()

Activity

Hide
Ryan Mulligan added a comment -

At dc4ba2e this happens at the REPL started by following the instructions at https://github.com/clojure/clojurescript/wiki/Quick-Start

ClojureScript:cljs.user> (.toString 1)
"Error evaluating:" (.toString 1) :as "1.toString()"
org.mozilla.javascript.EvaluatorException: missing ; before statement (<cl
js repl>#1)

Show
Ryan Mulligan added a comment - At dc4ba2e this happens at the REPL started by following the instructions at https://github.com/clojure/clojurescript/wiki/Quick-Start ClojureScript:cljs.user> (.toString 1) "Error evaluating:" (.toString 1) :as "1.toString()" org.mozilla.javascript.EvaluatorException: missing ; before statement (<cl js repl>#1)
Hide
Francis Avila added a comment -

Duplicate of CLJS-715

Show
Francis Avila added a comment - Duplicate of CLJS-715

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: