Use Object explicitly with "instanceof"
authorJongHeon Choi <j-h.choi@samsung.com>
Mon, 22 Jun 2015 07:45:25 +0000 (16:45 +0900)
committerHyunjin Park <hj.na.park@samsung.com>
Tue, 23 Jun 2015 11:11:15 +0000 (20:11 +0900)
Change-Id: I52b9c5c17355f2c868961fd4313497aa081d3a18

src/calendar/js/calendar.js
src/calendar/js/calendar_attendee.js
src/calendar/js/calendar_item.js
src/calendar/js/calendar_recurrence_rule.js
src/calendar/js/common.js
src/contact/js/common.js
src/exif/exif_api.js
src/mediacontroller/mediacontroller_api.js
src/notification/notification_api.js
src/utils/utils_api.js

index c18b3b59977e167a8c059ed00732b2235fca4aae..cd4195f0d9abe0947e3c735509dddee2aec555ab 100755 (executable)
@@ -13,6 +13,8 @@
  *    See the License for the specific language governing permissions and
  *    limitations under the License.
  */
+
+var _global = window || global || {};
  
 var CalendarType = {
   EVENT: 'EVENT',
@@ -51,7 +53,7 @@ var InternalCalendar = function(data) {
     }
   });
 
-  if (data instanceof Object) {
+  if (data instanceof _global.Object) {
     for (var prop in data) {
       if (this.hasOwnProperty(prop)) {
         this[prop] = data[prop];
index 66dbef2a3c030d2450f3f3372f49053d6a448c46..0db4f5511607b75fff3edb2c48b0a7daf204d9fc 100755 (executable)
@@ -13,6 +13,8 @@
  *    See the License for the specific language governing permissions and
  *    limitations under the License.
  */
+
+var _global = window || global || {};
  
 var AttendeeType = {
   INDIVIDUAL: 'INDIVIDUAL',
@@ -143,7 +145,7 @@ var CalendarAttendeeInit = function(data) {
     }
   });
 
-  if (data instanceof Object) {
+  if (data instanceof _global.Object) {
     for (var prop in data) {
       if (this.hasOwnProperty(prop)) {
         this[prop] = data[prop];
index 78860da2863b4950d43c65ad9283366af055fb6f..f7b012ac892fc3f1682b7eea1224057a1b18d9cb 100755 (executable)
@@ -14,6 +14,8 @@
  *    limitations under the License.
  */
 
+var _global = window || global || {};
+
 var CalendarTextFormat = {
   ICALENDAR_20: 'ICALENDAR_20',
   VCALENDAR_10: 'VCALENDAR_10'
@@ -142,7 +144,7 @@ var CalendarItem = function(data) {
       },
       set: function(v) {
         if (_edit.canEdit) {
-          if (v instanceof Object) {
+          if (v instanceof _global.Object) {
             _id = new CalendarEventId(v.uid, v.rid);
           } else {
             _id = converter_.toString(v, true);
@@ -334,7 +336,7 @@ var CalendarItem = function(data) {
     }
   });
 
-  if (data instanceof Object) {
+  if (data instanceof _global.Object) {
     for (var prop in data) {
       if (this.hasOwnProperty(prop)) {
         this[prop] = data[prop];
@@ -569,7 +571,7 @@ var CalendarTaskInit = function(data) {
     }
   });
 
-  if (data instanceof Object) {
+  if (data instanceof _global.Object) {
     for (var prop in data) {
       if (this.hasOwnProperty(prop)) {
         this[prop] = data[prop];
@@ -661,7 +663,7 @@ var CalendarEventInit = function(data) {
     }
   });
 
-  if (data instanceof Object) {
+  if (data instanceof _global.Object) {
     for (var prop in data) {
       if (this.hasOwnProperty(prop)) {
         this[prop] = data[prop];
index ffd50139ff73427fe6de8cd6fa13de05c1a404e5..b13ebffcf63f7f5eb472ced9aecada504cadd25d 100755 (executable)
@@ -14,6 +14,8 @@
  *    limitations under the License.
  */
 
+var _global = window || global || {};
+
 var RecurrenceRuleFrequency = {
   DAILY: 'DAILY',
   WEEKLY: 'WEEKLY',
@@ -143,7 +145,7 @@ var CalendarRecurrenceRuleInit = function(data) {
     }
   });
 
-  if (data instanceof Object) {
+  if (data instanceof _global.Object) {
     for (var prop in data) {
       if (this.hasOwnProperty(prop)) {
         this[prop] = data[prop];
index 767e694a6f260d00a2df83be48fe96ef53a97046..192f7fb4c7eb8309eeacf91bd1f29785fd256d40 100755 (executable)
@@ -14,6 +14,8 @@
  *    limitations under the License.
  */
 
+var _global = window || global || {};
+
 var utils_ = xwalk.utils;
 var dateConverter_ = utils_.dateConverter;
 var type_ = utils_.type;
@@ -115,7 +117,7 @@ ItemConverter.prototype.fromTizenObject = function(item) {
     } else if (item[prop] instanceof Array) {
       tmp[prop] = [];
       for (var i = 0, length = item[prop].length; i < length; i++) {
-        if (item[prop][i] instanceof Object) {
+        if (item[prop][i] instanceof _global.Object) {
           tmp[prop][i] = {};
           for (var p in item[prop][i]) {
             if (item[prop][i][p] instanceof tizen.TZDate) {
@@ -128,7 +130,7 @@ ItemConverter.prototype.fromTizenObject = function(item) {
           tmp[prop] = item[prop];
         }
       }
-    } else if (item[prop] instanceof Object) {
+    } else if (item[prop] instanceof _global.Object) {
       tmp[prop] = {};
       for (var p in item[prop]) {
         if (item[prop][p] instanceof tizen.TZDate) {
index 3e2d494c90d59bdd59d7f29025f405521572e06a..5f25a91f2238928d8a2214b29073fb4b7e096476 100755 (executable)
@@ -13,6 +13,8 @@
  *    See the License for the specific language governing permissions and
  *    limitations under the License.
  */
+
+var _global = window || global || {};
  
 var utils_ = xwalk.utils;
 var type_ = utils_.type;
@@ -44,7 +46,7 @@ var _toJsonObject = function(obj) {
     }
     return ret;
   }
-  if (obj instanceof Object) {
+  if (obj instanceof _global.Object) {
     ret = {};
     for (var prop in obj) {
       if (obj.hasOwnProperty(prop)) {
index 85d11342dc302da3f9395b1e3cba7fc1fe0bb24c..40face01d85f57a9cfe842920f277d4cc9e0d340 100755 (executable)
@@ -13,6 +13,8 @@
  *    See the License for the specific language governing permissions and
  *    limitations under the License.
  */
+
+var _global = window || global || {};
  
 var validator_ = xwalk.utils.validator;
 var type_ = xwalk.utils.type;
@@ -574,7 +576,7 @@ tizen.ExifInformation = function() {
   });
 
   //--- copy values from exifInitDict using setters above.
-  if (exifInitDict instanceof Object) {
+  if (exifInitDict instanceof _global.Object) {
     for (var prop in exifInitDict) {
       if (this.hasOwnProperty(prop)) {
         this[prop] = exifInitDict[prop];
index a19e47aeee4659b205f7ac28722ee967ec794dd6..d92093b734923524984de5a6a25dd3e6b1e58ea3 100755 (executable)
@@ -14,6 +14,8 @@
  *    limitations under the License.
  */
 
+var _global = window || global || {};
+
 var utils_ = xwalk.utils;
 var type_ = utils_.type;
 var converter_ = utils_.converter;
@@ -255,7 +257,7 @@ var MediaControllerMetadata = function(data) {
     }
   });
 
-  if (data instanceof Object) {
+  if (data instanceof _global.Object) {
     for (var prop in data) {
       if (data.hasOwnProperty(prop) && this.hasOwnProperty(prop)) {
         this[prop] = data[prop];
@@ -318,7 +320,7 @@ var MediaControllerPlaybackInfo = function(data) {
     }
   });
 
-  if (data instanceof Object) {
+  if (data instanceof _global.Object) {
     for (var prop in data) {
       if (data.hasOwnProperty(prop) && this.hasOwnProperty(prop)) {
         this[prop] = data[prop];
index 3aa36b8e1df6082c1a1a9e0c58a13a1504dc1d1b..c558df9b2b919238c691b301b9d68c72ac11a68e 100644 (file)
@@ -14,6 +14,8 @@
  *    limitations under the License.
  */
 
+var _global = window || global || {};
+
 var utils_ = xwalk.utils;
 var type_ = utils_.type;
 var converter_ = utils_.converter;
@@ -473,7 +475,7 @@ function NotificationInitDict(data) {
     }
   });
 
-  if (data instanceof Object) {
+  if (data instanceof _global.Object) {
     for (var prop in data) {
       if (this.hasOwnProperty(prop)) {
         this[prop] = data[prop];
@@ -539,7 +541,7 @@ function Notification(data) {
     }
   });
 
-  if (data instanceof Object) {
+  if (data instanceof _global.Object) {
     for (var prop in data) {
       if (data.hasOwnProperty(prop) && this.hasOwnProperty(prop)) {
         this[prop] = data[prop];
index f27126bb8905b226eb23ac127f70f8d1a2810925..c3586a276448b8481250dbdfa16601b9ecd0941f 100644 (file)
@@ -3,6 +3,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+var _global = window || global || {};
+
 /**
  * @deprecated Used only by validateArguments()
  */
@@ -24,7 +26,7 @@ DateConverter.prototype.toTZDate = function(v, isAllDay) {
     isAllDay = false;
   }
 
-  if (!(v instanceof Object)) {
+  if (!(v instanceof _global.Object)) {
     return v;
   }
 
@@ -1324,7 +1326,7 @@ var NativeBridge = (function (extension, debug) {
 // See http://168.219.209.56/gerrit/#/c/23472/ for more details.
 // In future exception definition could be moved back to Tizen module.
 function __isObject(object) {
-  return object instanceof Object;
+  return object instanceof _global.Object;
 }
 
 function __isUndefined(object) {