[Common] fix in WebAPIException
authorLukasz Bardeli <l.bardeli@samsung.com>
Mon, 20 Apr 2015 11:46:23 +0000 (13:46 +0200)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Tue, 21 Apr 2015 08:44:22 +0000 (17:44 +0900)
[Feature] Adaptation to documentation.
readonly unsigned short code
16-bit error code.
For the possible values of this attribute, see DOMException.

DOMException - http://www.w3.org/TR/dom/#domexception
The code exception field must return the value it was initialized to.

To throw a name exception run these steps:
1. Let code be zero.
2. If name is in the first column of the error names table and has a corresponding legacy code exception field value in the third column, set code to that value.
3. Throw a new DOMException exception, whose message is a user agent-defined value, name is name, and whose code exception field is code.

Change-Id: Ic14e6855220da2c66d38c50bb6f3439f26d05f0e
Signed-off-by: Lukasz Bardeli <l.bardeli@samsung.com>
src/utils/utils_api.js

index 1e906cc301440fd7ba63bfc1ba35f4f8d7479fd7..d0df487708d0ae1146eb41a6ca363cde572a4709 100644 (file)
@@ -1321,6 +1321,10 @@ var WebAPIException = function(code, message, name) {
       return;
   }
 
+  if (code_ > errors.DATA_CLONE_ERR) {
+    code_ = 0;
+  }
+
   // attributes
   Object.defineProperties(this, {
     code: {value: code_, writable: false, enumerable: true},