[webnfc] It should throw TypeError when passing undefined to nfc.push
Reported by
canx....@intel.com,
Apr 21 2017
|
||||||||
Issue descriptionSteps to reproduce the problem: Test case: https://thewebera.github.io/web-test-suite/web-nfc/nfc/nfc_push_exceptions.https.html Test Name: Test that passing undefined to nfc.push would raise TypeError. 1.Set the type of the message parameter is not DOMString or ArrayBuffer, e.g.: navigator.nfc.push(undefined) What is the expected behavior? TypeError is thrown. What went wrong? TypeMismatchError is thrown. Did this work before? N/A Does this work in other browsers? N/A Chrome version: 60.0.3074.0 Channel: canary OS Version: Android 5.1 Flash Version: Shockwave Flash 25.0 r0 According to the spec: https://w3c.github.io/web-nfc/#the-push-method Description: If the type of the message parameter is not DOMString or ArrayBuffer, and it is not an instance of NFCMessage, reject promise with "TypeError", and abort these steps.
,
Apr 21 2017
,
Apr 21 2017
canx.cao@ Could you make an issue for the spec? If passed parameter is of unexpected type, TypeError should be thrown. I can align implementation and throw TypeError instead of TypeMismatchError.
,
Apr 24 2017
,
Apr 24 2017
Created spec issue https://github.com/w3c/web-nfc/pull/111
,
Apr 24 2017
,
Apr 25 2017
,
Apr 25 2017
,
Apr 26 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5f758d2372e693f69e1f3b1da495d95e5434e07f commit 5f758d2372e693f69e1f3b1da495d95e5434e07f Author: alexander.shalamov <alexander.shalamov@intel.com> Date: Wed Apr 26 07:06:10 2017 [webnfc] Nfc.push method must reject promise with TypeError According to latest changes in specification [1,2], when argument of invalid type is provided to nfc.push function, promise must be rejected with TypeError, instead of SyntaxError. [1] https://w3c.github.io/web-nfc/#dom-nfc-push [2] https://github.com/w3c/web-nfc/issues/110 BUG= 714034 Review-Url: https://codereview.chromium.org/2836063004 Cr-Commit-Position: refs/heads/master@{#467258} [modify] https://crrev.com/5f758d2372e693f69e1f3b1da495d95e5434e07f/third_party/WebKit/LayoutTests/nfc/push.html [modify] https://crrev.com/5f758d2372e693f69e1f3b1da495d95e5434e07f/third_party/WebKit/Source/modules/nfc/NFC.cpp
,
Apr 26 2017
,
May 4 2017
QA test this issue with Chrome 60.0.3087.3, it has been fixed. Close.
,
May 4 2017
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by canx....@intel.com
, Apr 21 2017