Skip to content

Commit

Permalink
Fix illegal console.error usage in README
Browse files Browse the repository at this point in the history
Passing `console.error` as a standalone function without calling `.bind()` on it first results in an `Illegal invocation` when you eventually call it. I opted instead to just wrap in a function for some of the mobile browsers that still don't implement `Function.bind`
  • Loading branch information
machty committed Apr 22, 2016
1 parent 4d9aca1 commit c51a010
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ cordova.plugins.locationManager.requestWhenInUseAuthorization();
// or cordova.plugins.locationManager.requestAlwaysAuthorization()
cordova.plugins.locationManager.startMonitoringForRegion(beaconRegion)
.fail(console.error)
.fail(function(e) { console.error(e); })
.done();
```
Expand All @@ -142,7 +142,7 @@ var major = 5;
var beaconRegion = new cordova.plugins.locationManager.BeaconRegion(identifier, uuid, major, minor);
cordova.plugins.locationManager.stopMonitoringForRegion(beaconRegion)
.fail(console.error)
.fail(function(e) { console.error(e); })
.done();
```
Expand Down Expand Up @@ -198,7 +198,7 @@ cordova.plugins.locationManager.requestWhenInUseAuthorization();
// or cordova.plugins.locationManager.requestAlwaysAuthorization()
cordova.plugins.locationManager.startRangingBeaconsInRegion(beaconRegion)
.fail(console.error)
.fail(function(e) { console.error(e); })
.done();
```
Expand All @@ -212,7 +212,7 @@ var major = 5;
var beaconRegion = new cordova.plugins.locationManager.BeaconRegion(identifier, uuid, major, minor);
cordova.plugins.locationManager.stopRangingBeaconsInRegion(beaconRegion)
.fail(console.error)
.fail(function(e) { console.error(e); })
.done();
```
Expand All @@ -224,7 +224,7 @@ cordova.plugins.locationManager.isAdvertisingAvailable()
.then(function(isSupported){
console.log("isSupported: " + isSupported);
})
.fail(console.error)
.fail(function(e) { console.error(e); })
.done();
```
Expand All @@ -236,7 +236,7 @@ cordova.plugins.locationManager.isAdvertising()
.then(function(isAdvertising){
console.log("isAdvertising: " + isAdvertising);
})
.fail(console.error)
.fail(function(e) { console.error(e); })
.done();
```
Expand Down Expand Up @@ -277,15 +277,15 @@ cordova.plugins.locationManager.isAdvertisingAvailable()
console.log("Advertising not supported");
}
})
.fail(console.error)
.fail(function(e) { console.error(e); })
.done();
```

##### Stopping the advertising (iOS only)
```
cordova.plugins.locationManager.stopAdvertising()
.fail(console.error)
.fail(function(e) { console.error(e); })
.done();
```
Expand All @@ -302,7 +302,7 @@ cordova.plugins.locationManager.isBluetoothEnabled()
cordova.plugins.locationManager.enableBluetooth();
}
})
.fail(console.error)
.fail(function(e) { console.error(e); })
.done();
```
Expand Down

0 comments on commit c51a010

Please sign in to comment.