ClojureScript

goog-defines broken for integers

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:

Description

Using goog-define with integer values results in cljs.closure/make-options attempting to call .setDefineToIntegerLiteral on the compiler-options object. That method does not exist; the correct method is .setDefineToNumberLiteral. Note however that calls to .setDefineToNumberLiteral will fail when the value is a long; it might make sense to always use .setDefineToDoubleLiteral when the value is a number. Integers passed to .setDefineToDoubleLiteral remain integers in the output javascript, so it seems harmless enough to do it that way.

Activity

Hide
Tom Connors added a comment -

Patch for using setDefineToDoubleLiteral for all numbers.

Show
Tom Connors added a comment - Patch for using setDefineToDoubleLiteral for all numbers.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: