Created
March 10, 2012 08:18
-
-
Save Constellation/2010815 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
// strict check | |
// | |
// append below snippet | |
// | |
// var isStrict = false | |
// try { Object.freeze({}).v = true; } catch (e) { isStrict = true; } | |
// | |
function strict() { | |
'use strict'; | |
var isStrict = false; | |
try { | |
Object.freeze({}).v = true; | |
} catch (e) { | |
isStrict = true; | |
} | |
console.log(isStrict); | |
} | |
function nonStrict() { | |
var isStrict = false; | |
try { | |
Object.freeze({}).v = true; | |
} catch (e) { | |
isStrict = true; | |
} | |
console.log(isStrict); | |
} | |
strict(); | |
nonStrict(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment