Last active
June 13, 2016 22:37
-
-
Save mkelley82/501fa56a093a7edbc39467aa4021bb99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var doesDefinePropertyWork = function doesDefinePropertyWork(object) { | |
try { | |
Object.defineProperty(object, 'sentinel', {}); | |
return 'sentinel' in object; | |
} catch (exception) { | |
return false; | |
} | |
}; | |
var definePropertyWorksOnObject = doesDefinePropertyWork({}); | |
if (!definePropertyWorksOnObject) { | |
// Object.defineProperty does not work on object | |
window.location.replace('http://www.example.com') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment