Skip to content

Commit

Permalink
CB-7868 Make <clobbers> on navigator not break on some versions of An…
Browse files Browse the repository at this point in the history
…droid
  • Loading branch information
agrieve committed Nov 4, 2014
1 parent 91157c2 commit f0ceadf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/common/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down

0 comments on commit f0ceadf

Please sign in to comment.