New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 718351 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Email to this user bounced
Closed: May 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

[webnfc]nfc.push should throw TypeError when parameter is 'number'

Reported by canx....@intel.com, May 4 2017

Issue description

Steps to reproduce the problem:
Test Case: https://thewebera.github.io/web-test-suite/web-nfc/nfc/nfc_push_exceptions.https.html
Test Name: nfc.push should fail with TypeError when parameter is 'number'
1.Set the NFCMessage as below:
navigator.nfc.push(test_number_data)

What is the expected behavior?
TypeError is thrown.

What went wrong?
No error, test case time out.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 60.0.3087.3  Channel: canary
OS Version: Nexus 7(Android 5.1)
Flash Version: Shockwave Flash 25.0 r0

According to spec: 10.7.1 The push() method  (https://w3c.github.io/web-nfc/#the-push-method)
If the message parameter is not of type defined by the NFCPushMessage union, reject promise with "TypeError", and abort these steps.

So if we push a number to NFC tag, "TypeError" should be thrown.
 
Components: Blink>NFC
Owner: alexande...@intel.com
Status: Assigned (was: Unconfirmed)
Status: WontFix (was: Assigned)
This is due to implicit number to string conversion.
@alexander.shalamov, according to spec below, number is not part of NFCPushMessage, do you think if spec should make some change for it?

'typedef (DOMString or ArrayBuffer or NFCMessage) NFCPushMessage;'
wanming.lin@ What would we add there? double, short, float?

According to WebIDL https://www.w3.org/TR/WebIDL-1/#es-DOMString and ecma spec
https://tc39.github.io/ecma262/#sec-tostring it is valid to have web idl interface with method(DOMString str); and call it as method(42);

Could you also read webidl and ecma specs links, maybe I misunderstood or missed something. Thanks.
@shalamov, thanks, you are right. 

Comment 6 Deleted

Comment 7 Deleted

Sign in to add a comment