关键字:seal, freeze, property descriptor. 1.Object.seal() 参考文档(2)中这样描述: The Object.seal() method seals an object, preventing new properties from being added to it and marking all existing properties as non-configurable. Values of present properties can…
1 Object.seal(O)的调用 When the seal function is called, the following steps are taken: If Type(O) is not Object throw a TypeError exception. For each named own property name P of O, Let desc be the result of calling the [[GetOwnProperty]] int…
var name = "The window"; var object = { name: "My Object", getName: function(){ console.log(this.name); } } object.getName(); // My Object (object.getName)(); // My Object (object.getName = object.getName)(); // The window 来分析下调用的结果: 第…