Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
[IAP]Throw an error when the options.channel is undefined
Browse files Browse the repository at this point in the history
If the options.channel is undefined, when passing it to navigator.iap.init()
method, the Promise should be rejected and an error named
"InvalidAccessError" is thrown also.

BUG=XWALK-6798
  • Loading branch information
Minggang Wang committed Apr 25, 2016
1 parent c12990b commit a5ac0c1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions iap/iap.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ exports.init = function(options) {
return new Promise(function(resolve, reject) {
if (g_initialized)
throw new DOMError("InvalidStateError");
if (typeof(options.channel) === "undefined")
throw new DOMError("InvalidAccessError");
var resolveWrapper = function() {
g_initialized = true;
resolve();
Expand Down

0 comments on commit a5ac0c1

Please sign in to comment.