[Exif] Use validator_.isConstructorCall()
authorRafal Lelusz <r.lelusz@samsung.com>
Tue, 23 Dec 2014 16:33:48 +0000 (17:33 +0100)
committerRafal Galka <r.galka@samsung.com>
Mon, 29 Dec 2014 10:11:10 +0000 (19:11 +0900)
Change-Id: Ie3c791e27a1fa9ee22c0ea77c44a2aa378776a78
Signed-off-by: Rafal Lelusz <r.lelusz@samsung.com>
src/exif/exif_api.js

index 1ca5275..0557352 100644 (file)
@@ -115,9 +115,7 @@ ExifManager.prototype.getThumbnail = function() {
 
 // this function passes ExifInformation_exposureProgram_attribute test:
 tizen.ExifInformation = function() {
-  if (!this || this.constructor !== tizen.ExifInformation) {
-    throw new TypeError;
-  }
+  validator_.isConstructorCall(this, tizen.ExifInformation);
 
   var args = validator_.validateArgs(arguments, [
     {
@@ -128,8 +126,6 @@ tizen.ExifInformation = function() {
     }
   ]);
 
-  var exifInitDict = args.ExifInitDict;
-
   var uri_ = null;
   var width_ = null;
   var height_ = null;
@@ -150,6 +146,7 @@ tizen.ExifInformation = function() {
   var gpsTime_ = null;
   var userComment_ = null;
 
+  var exifInitDict = args.ExifInitDict;
   if (exifInitDict) {
     if (exifInitDict['uri'] == null) {
       throw new tizen.WebAPIException(tizen.WebAPIException.INVALID_VALUES_ERR,