Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading InputElement.valueAsDate results in NullError (Cannot call "getTime" on null), but should just be null value #17625

Closed
DartBot opened this issue Mar 19, 2014 · 3 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant library-html P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@DartBot
Copy link

DartBot commented Mar 19, 2014

This issue was originally filed by @chalin


What steps will reproduce the problem?

  1. Load the project attached as a .zip (also available as this GitHub gist: https://gist.github.com/chalin/9645690)
  2. pub build
  3. Run under Chrome.
  4. Click on the links to see what is returned by calls to the three InputElement.value* properties.
        In particular, notice that reading valueAsDate results in a NullError.

What is the expected output? What do you see instead?

Expected output (as generated from Dartium)
number.value => ''
number.valueAsNumber => NaN
number.valueAsDate => null
date.value => ''
date.valueAsNumber => NaN
date.valueAsDate => null

etc for time, datetime, month and week as well.

Instead, what we get when runing the JS version from Chrome:

number.value => ''
number.valueAsNumber => NaN
number.valueAsDate => Exception: NullError: Cannot call "getTime" on null
date.value => ''
date.valueAsNumber => NaN
date.valueAsDate => Exception: NullError: Cannot call "getTime" on null

etc for time, datetime, month and week as well.

What version of the product are you using? On what operating system?

Dart SDK version 1.3.0-dev.4.1
MacOS X 10.9

Please provide any additional information below.


Attachment:
dart_date_bug.zip (86.59 KB)

@lrhn
Copy link
Member

lrhn commented Mar 19, 2014

Added Area-HTML, Triaged labels.

@kevmoo
Copy link
Member

kevmoo commented Apr 7, 2014

Removed Area-HTML label.
Added Area-Library, Library-Html labels.

@alan-knight
Copy link
Contributor

Removed Priority-Unassigned label.
Added Priority-Medium label.

@DartBot DartBot added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-html labels Jan 15, 2015
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed triaged labels Mar 1, 2016
@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant library-html P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

5 participants