From 3535646260c434d0ed48e3735404e51064868c8d Mon Sep 17 00:00:00 2001
From: Pawel Andruszkiewicz
Date: Tue, 21 Apr 2015 10:00:36 +0200
Subject: [PATCH] Fixed validation of method calls, appropriate parameter type
should be FUNCTION.
Change-Id: Ia09c1d93bb2f161e21544811b001536f0d4d222f
---
src/nfc/nfc_api.js | 12 ++++--------
src/radio/radio_api.js | 3 +--
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/src/nfc/nfc_api.js b/src/nfc/nfc_api.js
index 6f63f301..cb8ae021 100644
--- a/src/nfc/nfc_api.js
+++ b/src/nfc/nfc_api.js
@@ -407,8 +407,7 @@ NFCAdapter.prototype.addCardEmulationModeChangeListener = function() {
var args = validator_.validateArgs(arguments, [
{
name: 'callback',
- type: types_.LISTENER,
- values: ['onchanged']
+ type: types_.FUNCTION
}
]);
@@ -449,8 +448,7 @@ NFCAdapter.prototype.addTransactionEventListener = function() {
},
{
name: 'callback',
- type: types_.LISTENER,
- values: ['ondetected']
+ type: types_.FUNCTION
}
]);
@@ -510,8 +508,7 @@ NFCAdapter.prototype.addActiveSecureElementChangeListener = function() {
var args = validator_.validateArgs(arguments, [
{
name: 'callback',
- type: types_.LISTENER,
- values: ['onchanged']
+ type: types_.FUNCTION
}
]);
@@ -1046,8 +1043,7 @@ NFCPeer.prototype.setReceiveNDEFListener = function() {
var args = validator_.validateArgs(arguments, [
{
name: 'listener',
- type: types_.LISTENER,
- values: ['onsuccess']
+ type: types_.FUNCTION
}
]);
diff --git a/src/radio/radio_api.js b/src/radio/radio_api.js
index 672f4ca1..eacc8078 100644
--- a/src/radio/radio_api.js
+++ b/src/radio/radio_api.js
@@ -328,8 +328,7 @@ FMRadioManager.prototype.unsetFMRadioInterruptedListener = function() {
FMRadioManager.prototype.setAntennaChangeListener = function() {
var args = validator_.validateArgs(arguments, [ {
name : 'changeCallback',
- type : types_.LISTENER,
- values : [ 'onchange' ]
+ type : types_.FUNCTION
} ]);
antennaCBmanager.FMRadioAntennaChangeSet(args.changeCallback);
--
2.34.1