mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1116725
- TypeError : isLost is a readonly attribute. r=smaug, dimi
This commit is contained in:
parent
fa3994fa30
commit
ca7f1552fe
@ -192,6 +192,10 @@ MozNFCTagImpl.prototype = {
|
|||||||
return callback.promise;
|
return callback.promise;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
notifyLost: function notifyLost() {
|
||||||
|
this.isLost = true;
|
||||||
|
},
|
||||||
|
|
||||||
classID: Components.ID("{4e1e2e90-3137-11e3-aa6e-0800200c9a66}"),
|
classID: Components.ID("{4e1e2e90-3137-11e3-aa6e-0800200c9a66}"),
|
||||||
contractID: "@mozilla.org/nfc/tag;1",
|
contractID: "@mozilla.org/nfc/tag;1",
|
||||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
|
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
|
||||||
@ -244,6 +248,10 @@ MozNFCPeerImpl.prototype = {
|
|||||||
return callback.promise;
|
return callback.promise;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
notifyLost: function notifyLost() {
|
||||||
|
this.isLost = true;
|
||||||
|
},
|
||||||
|
|
||||||
classID: Components.ID("{c1b2bcf0-35eb-11e3-aa6e-0800200c9a66}"),
|
classID: Components.ID("{c1b2bcf0-35eb-11e3-aa6e-0800200c9a66}"),
|
||||||
contractID: "@mozilla.org/nfc/peer;1",
|
contractID: "@mozilla.org/nfc/peer;1",
|
||||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
|
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
|
||||||
@ -432,7 +440,7 @@ MozNFCImpl.prototype = {
|
|||||||
this, /* useCapture */false);
|
this, /* useCapture */false);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.nfcTag.isLost = true;
|
this.nfcTag.notifyLost();
|
||||||
this.nfcTag = null;
|
this.nfcTag = null;
|
||||||
|
|
||||||
debug("fire ontaglost " + sessionToken);
|
debug("fire ontaglost " + sessionToken);
|
||||||
@ -491,7 +499,7 @@ MozNFCImpl.prototype = {
|
|||||||
this, /* useCapture */false);
|
this, /* useCapture */false);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.nfcPeer.isLost = true;
|
this.nfcPeer.notifyLost();
|
||||||
this.nfcPeer = null;
|
this.nfcPeer = null;
|
||||||
|
|
||||||
debug("fire onpeerlost");
|
debug("fire onpeerlost");
|
||||||
|
@ -10,6 +10,11 @@
|
|||||||
|
|
||||||
[JSImplementation="@mozilla.org/nfc/peer;1", AvailableIn="PrivilegedApps"]
|
[JSImplementation="@mozilla.org/nfc/peer;1", AvailableIn="PrivilegedApps"]
|
||||||
interface MozNFCPeer {
|
interface MozNFCPeer {
|
||||||
|
/**
|
||||||
|
* Indicate if this peer is already lost.
|
||||||
|
*/
|
||||||
|
readonly attribute boolean isLost;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send NDEF data to peer device.
|
* Send NDEF data to peer device.
|
||||||
*/
|
*/
|
||||||
@ -28,8 +33,6 @@ partial interface MozNFCPeer {
|
|||||||
[ChromeOnly]
|
[ChromeOnly]
|
||||||
attribute DOMString session;
|
attribute DOMString session;
|
||||||
|
|
||||||
/**
|
[ChromeOnly]
|
||||||
* Indicate if this peer is already lost.
|
void notifyLost();
|
||||||
*/
|
|
||||||
readonly attribute boolean isLost;
|
|
||||||
};
|
};
|
||||||
|
@ -72,6 +72,11 @@ interface MozNFCTag {
|
|||||||
*/
|
*/
|
||||||
readonly attribute boolean? canBeMadeReadOnly;
|
readonly attribute boolean? canBeMadeReadOnly;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicate if this tag is already lost.
|
||||||
|
*/
|
||||||
|
readonly attribute boolean isLost;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read current NDEF data on the tag.
|
* Read current NDEF data on the tag.
|
||||||
*/
|
*/
|
||||||
@ -102,8 +107,6 @@ partial interface MozNFCTag {
|
|||||||
[ChromeOnly]
|
[ChromeOnly]
|
||||||
attribute DOMString session;
|
attribute DOMString session;
|
||||||
|
|
||||||
/**
|
[ChromeOnly]
|
||||||
* Indicate if this tag is already lost.
|
void notifyLost();
|
||||||
*/
|
|
||||||
readonly attribute boolean isLost;
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user