15.2.3.8 Object.seal(O)

2010-07-04

object Object.seal(O:object) throws TypeError

Calling this function on an object O will prevent you from extending O any more. This means you can no longer add or change properties on O. See also Object.freeze.

Code: (Meta Ecma)
Object.seal = function(O){
if (Type(O) != 'Object') throw TypeError;
for (P in O) {
var desc = O.[[GetOwnProperty]](P);
if (desc.[[Configurable]]) desc.[[Configurable]] = false;
O.[[DefineOwnProperty]](P, desc, true);
}
O.[[Extensible]] = false;
return O;
}