Permalink
Browse files

CB-7868 Make <clobbers> on navigator not break on some versions of An…

…droid
  • Loading branch information...
1 parent 91157c2 commit f0ceadfd6f59c3bfc7db2922bfd08b4ea8cafe45 @agrieve agrieve committed Nov 4, 2014
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/common/builder.js
View
9 src/common/builder.js
@@ -31,9 +31,14 @@ function each(objects, func, context) {
function clobber(obj, key, value) {
exports.replaceHookForTesting(obj, key);
- obj[key] = value;
+ var needsProperty = false;
+ try {
+ obj[key] = value;
+ } catch (e) {
+ needsProperty = true;
+ }
// Getters can only be overridden by getters.
- if (obj[key] !== value) {
+ if (needsProperty || obj[key] !== value) {
utils.defineGetter(obj, key, function() {
return value;
});

0 comments on commit f0ceadf

Please sign in to comment.