Skip to content

Instantly share code, notes, and snippets.

@eventualbuddha
Created June 3, 2013 20:07
Show Gist options
  • Save eventualbuddha/5700942 to your computer and use it in GitHub Desktop.
Save eventualbuddha/5700942 to your computer and use it in GitHub Desktop.
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