Skip to content

Commit

Permalink
Fix Object.defineProperty feature detection
Browse files Browse the repository at this point in the history
The feature test that checked if Object.defineProperty was working
correctly wasn't actually testing that it defined properties. This
caused conflicts with shams in IE 8 and below.
  • Loading branch information
juandopazo committed Apr 24, 2015
1 parent 1d96e68 commit 7ebdded
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ import {
var Intl = {},

realDefineProp = (function () {
try { return !!Object.defineProperty({}, 'a', {}); }
catch (e) { return false; }
var sentinel = {};
try {
Object.defineProperty(sentinel, 'a', {});
return 'a' in sentinel;
} catch (e) {
return false;
}
})(),

// Need a workaround for getters in ES3
Expand Down

0 comments on commit 7ebdded

Please sign in to comment.