cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject js commit: CB-6911 - iOS 8 - "deprecated attempt to access property" errors when accessing anything off window.navigator
Date Mon, 15 Sep 2014 07:25:28 GMT
Repository: cordova-js
Updated Branches:
  refs/heads/master 1258511f4 -> 6c7a76fcd


CB-6911 - iOS 8 - "deprecated attempt to access property" errors when accessing anything off
window.navigator


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/6c7a76fc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/6c7a76fc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/6c7a76fc

Branch: refs/heads/master
Commit: 6c7a76fcd2f0aa60e0879d1417e1ac0ca44f2c6c
Parents: 1258511
Author: Shazron Abdullah <shazron@apache.org>
Authored: Tue Sep 9 19:09:28 2014 -0700
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Tue Sep 9 19:09:28 2014 -0700

----------------------------------------------------------------------
 src/common/init.js   | 10 ++++++++++
 src/common/init_b.js | 10 ++++++++++
 2 files changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/6c7a76fc/src/common/init.js
----------------------------------------------------------------------
diff --git a/src/common/init.js b/src/common/init.js
index 4f4882c..758544e 100644
--- a/src/common/init.js
+++ b/src/common/init.js
@@ -55,6 +55,16 @@ function replaceNavigator(origNavigator) {
         for (var key in origNavigator) {
             if (typeof origNavigator[key] == 'function') {
                 newNavigator[key] = origNavigator[key].bind(origNavigator);
+            } else {
+                (function(k) {
+                        Object.defineProperty(newNavigator, k, {
+                            get: function() {
+                                return origNavigator[k];
+                            },
+                            configurable: true,
+                            enumerable: true
+                        });
+                    })(key);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/6c7a76fc/src/common/init_b.js
----------------------------------------------------------------------
diff --git a/src/common/init_b.js b/src/common/init_b.js
index 32c2068..f00409b 100644
--- a/src/common/init_b.js
+++ b/src/common/init_b.js
@@ -56,6 +56,16 @@ function replaceNavigator(origNavigator) {
         for (var key in origNavigator) {
             if (typeof origNavigator[key] == 'function') {
                 newNavigator[key] = origNavigator[key].bind(origNavigator);
+            } else {
+                (function(k) {
+                        Object.defineProperty(newNavigator, k, {
+                            get: function() {
+                                return origNavigator[k];
+                            },
+                            configurable: true,
+                            enumerable: true
+                        });
+                    })(key);
             }
         }
     }


Mime
View raw message