From 1e169745406f6b4c335ae064564224e50ab8d270 Mon Sep 17 00:00:00 2001 From: Evan Xd Date: Sun, 14 Jun 2015 18:53:42 +0800 Subject: [PATCH] Fix bugs: Assign correct value to this.name and this.address --- lib/bluetooth_helper.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/bluetooth_helper.js b/lib/bluetooth_helper.js index e1394c3..49101a6 100644 --- a/lib/bluetooth_helper.js +++ b/lib/bluetooth_helper.js @@ -8,9 +8,9 @@ var bluetooth = navigator.mozBluetooth; function BluetoothHelper(options) { - this.name = options && options.name; - this.address = options && options.address; - if (this.name || this.address) { + if (options && (options.name || options.address)) { + this.name = options.name; + this.address = options.address; bluetooth.addEventListener('attributechanged', this._handleAttributechanged.bind(this)); }