permission denied to access property 'then'

VERIFIED FIXED in Firefox 38, Firefox OS v2.2

Status

Firefox OS
NFC
VERIFIED FIXED
3 years ago
3 years ago

People

(Reporter: allstars, Assigned: fabrice)

Tracking

unspecified
2.2 S4 (23jan)
ARM
Gonk (Firefox OS)

Firefox Tracking Flags

(firefox36 wontfix, firefox37 wontfix, firefox38 fixed, b2g-v2.2 verified, b2g-master verified)

Details

Attachments

(1 attachment)

When calling MozNFCTag.readNDEF

tag.readNDEF().then(records => {dump(records);});

Error: Permission denied to access property 'then'.
(Reporter)

Updated

3 years ago
Duplicate of this bug: 1103171

Updated

3 years ago
QA Whiteboard: [COM=NFC]
(Reporter)

Updated

3 years ago
Assignee: nobody → allstars.chh
(Assignee)

Comment 2

3 years ago
That usually means that you're not creating the Promise out of the right window object. Eg. in chrome JS, don't pass a |new Promise()| to content, but get the window object for the page and do |new pageWindow.Promise()|
So far it seems that the type of resolve() causes this error. In this bug the type returned in resolve is Array of MozNDEFRecord. [1]

And the exception is thrown in Promise [2], the object is not thenable.

[1]: https://dxr.mozilla.org/mozilla-central/source/dom/nfc/nsNfc.js#74
[2]: https://dxr.mozilla.org/mozilla-central/source/dom/promise/Promise.cpp#1095
(Assignee)

Comment 4

3 years ago
Created attachment 8549160 [details] [diff] [review]
nfc.patch

Yoshi, the array was not created on the right global. Can you test this patch? thanks!
Assignee: allstars.chh → fabrice
Attachment #8549160 - Flags: review?(allstars.chh)
Comment on attachment 8549160 [details] [diff] [review]
nfc.patch

Review of attachment 8549160 [details] [diff] [review]:
-----------------------------------------------------------------

Great, it works.

Thanks for the help. :)
Attachment #8549160 - Flags: review?(allstars.chh) → review+
I'll let Alison decide if we should uplift to Gecko37.
As I tested last week this was still working.
Flags: needinfo?(ashiue)
Alison said this also occurs on v2.2
Comment on attachment 8549160 [details] [diff] [review]
nfc.patch

NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
Possibly Bug 996397.

User impact if declined: 
readNDEF() cannot work.

Testing completed: 
Manually.

Risk to taking this patch (and alternatives if risky): 
No.

String or UUID changes made by this patch:
No.
Attachment #8549160 - Flags: approval-mozilla-b2g37?
(Reporter)

Updated

3 years ago
Flags: needinfo?(ashiue)
https://hg.mozilla.org/mozilla-central/rev/7c9bb120b816
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED

Updated

3 years ago
Attachment #8549160 - Flags: approval-mozilla-b2g37? → approval-mozilla-b2g37+
https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/335a77b327e8
status-b2g-v2.2: --- → fixed
status-b2g-master: --- → fixed
status-firefox36: --- → wontfix
status-firefox37: --- → wontfix
status-firefox38: --- → fixed
Target Milestone: --- → 2.2 S4 (23jan)

Comment 12

3 years ago
Verified on
[2.2]
Gaia-Rev        e4f9b5da3751798f9cc5d95f302c30722cc11fca
Gecko-Rev       https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/4a90da67661e
Build-ID        20150121162503
Version         37.0a2
Device-Name     flame
FW-Release      4.4.2
FW-Incremental  eng.cltbld.20150121.201218
FW-Date         Wed Jan 21 20:12:28 EST 2015
Bootloader      L1TC000118D0

[3.0]
Gaia-Rev        917b6c36717fddc6e71ffc1ec249633c8044c93c
Gecko-Rev       https://hg.mozilla.org/mozilla-central/rev/34e2d2bd7ec4
Build-ID        20150121160202
Version         38.0a1
Device-Name     flame
FW-Release      4.4.2
FW-Incremental  eng.cltbld.20150121.192948
FW-Date         Wed Jan 21 19:29:59 EST 2015
Bootloader      L1TC000118D0
Status: RESOLVED → VERIFIED
status-b2g-v2.2: fixed → verified
status-b2g-master: fixed → verified
You need to log in before you can comment on or make changes to this bug.