Skip to content

Date constructor should accept 'null' as a valid value when using strictNullChecks #12034

Closed
@guncha

Description

@guncha

TypeScript Version: nightly 2.1.0-dev.20161103

Code

let t = new Date(null) // Argument of type 'null' is not assignable to parameter of type 'string'

According to the spec, the result is going to be the same as new Date(+0).

http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions