<< Back to previous view

[CLJS-761] no method may be called on number literals Created: 02/Feb/14  Updated: 20/Feb/14  Resolved: 20/Feb/14

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Ryan Mulligan Assignee: Unassigned
Resolution: Duplicate Votes: 0
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()



 Comments   
Comment by Ryan Mulligan [ 02/Feb/14 1:11 PM ]

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)

Comment by Francis Avila [ 03/Feb/14 10:36 AM ]

Duplicate of CLJS-715

Generated at Thu Oct 02 09:37:51 CDT 2014 using JIRA 4.4#649-r158309.