File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -446,17 +446,17 @@ var foo = 1
446446
447447因为当 JS 解释器在遇到非匿名的立即执行函数时,会创建一个辅助的特定对象,然后将函数名称作为这个对象的属性,因此函数内部才可以访问到 ` foo ` ,但是这个值又是只读的,所以对它的赋值并不生效,所以打印的结果还是这个函数,并且外部的值也没有发生更改。
448448
449- > ``` js
450- > specialObject = {};
451- >
452- > Scope = specialObject + Scope;
453- >
454- > foo = new FunctionExpression ;
455- > foo.[[Scope]] = Scope;
456- > specialObject .foo = foo; // {DontDelete}, {ReadOnly}
457- >
458- > delete Scope[0 ]; // remove specialObject from the front of scope chain
459- > ` ` `
449+ ``` js
450+ specialObject = {};
451+
452+ Scope = specialObject + Scope;
453+
454+ foo = new FunctionExpression ;
455+ foo.[[Scope]] = Scope;
456+ specialObject .foo = foo; // {DontDelete}, {ReadOnly}
457+
458+ delete Scope[0 ]; // remove specialObject from the front of scope chain
459+ ```
460460
461461# 闭包
462462
You can’t perform that action at this time.
0 commit comments