ClojureScript

Null check is not enforced on numeric functions

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    ClojureScript 0.0-1806 (lein-cljsbuild 0.3.2)

Description

The null checks are enforced in Clojure, but not in CLJS.

In Clojure:

user=> (if (< nil 1) "foo" "bar")
NullPointerException   clojure.lang.Numbers.ops (Numbers.java:942)

In CLJS:

ClojureScript:cljs.user> (if (< nil 1) "foo" "bar")
"foo"

Activity

Hide
David Nolen added a comment -

There's not much we can do about this without adding expensive checks which we're not going to do.

Show
David Nolen added a comment - There's not much we can do about this without adding expensive checks which we're not going to do.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: