We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当JavaScript代码执行一段可执行代码(executable code)时,会创建对应的执行上下文(execution context)。
对于每个执行上下文,都有三个重要属性:
function foo() { function bar() { ... } }
函数创建时,各自的[[scope]]为:
foo.[[scope]] = [ globalContext.VO ]; bar.[[scope]] = [ fooContext.AO, globalContext.VO ];
Scope = [AO].concat([[Scope]]);
JavaScript深入之从ECMAScript规范解读this
The text was updated successfully, but these errors were encountered:
No branches or pull requests
前言
当JavaScript代码执行一段可执行代码(executable code)时,会创建对应的执行上下文(execution context)。
对于每个执行上下文,都有三个重要属性:
-作用域链(Scope chain)
今天重点讲讲作用域链。
作用域链
函数创建-[[scope]],函数创建时,就会保存所有父变量对象到其中。
函数创建时,各自的[[scope]]为:
函数激活
Scope = [AO].concat([[Scope]]);
下一篇文章
JavaScript深入之从ECMAScript规范解读this
The text was updated successfully, but these errors were encountered: