// property [[Class]] is "Function" F.[[Class]] = "Function"
// a prototype of a function object F.[[Prototype]] = Function.prototype
// reference to function itself // [[Call]] is activated by call expression F() // and creates a new execution context // 函数调用时执行[[Call]],并创建执行上下文 F.[[Call]] = <referencetofunction> // built in general constructor of objects // [[Construct]] is activated via "new" keyword // and it is the one who allocates memory for new // objects; then it calls F.[[Call]] // to initialize created objects passing as // "this" value newly created object // 当使用 new 操作符时会调用[[Construct]],并为新的对象分配内存,再调用[[Call]] F.[[Construct]] = internalConstructor // scope chain of the current context // i.e. context which creates function F // 这里说明了使用new操作符与直接调用的不同, // 不同的原型链,不同的this指向 F.[[Scope]] = activeContext.Scope // if this functions is created // via new Function(...), then F.[[Scope]] = globalContext.Scope // number of formal parameters // 函数参数 F.length = countParameters // a prototype of created by F objects __objectPrototype = new Object(); __objectPrototype.constructor = F // {DontEnum}, is not enumerable in loops F.prototype = __objectPrototype return F
需要注意的是,*F.[[Prototype]]*是函数(构造器)的原型,也被这个函数所创建的对象的原型。怎么翻译都感觉不对,自己体会吧。(F.[[Prototype]] is a prototype of the function (constructor) and F.prototype is a prototype of objects created by this function)