Created
June 3, 2013 20:07
-
-
Save eventualbuddha/5700942 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 a = []; | |
Object.freeze(a); | |
a.push('foo'); | |
if (a.length === 1) { | |
console.log("FAIL Object.freeze() with Array"); | |
} else { | |
console.log("PASS Object.freeze() with Array"); | |
} | |
var o = {}; | |
Object.freeze(o); | |
o.foo = 'bar'; | |
if (o.foo === 'bar') { | |
console.log("FAIL Object.freeze() on Object"); | |
} else { | |
console.log("PASS Object.freeze() on Object"); | |
} | |
phantom.exit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment