首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ECMAScript 6什么是范围?

ECMAScript 6什么是范围?
EN

Stack Overflow用户
提问于 2017-12-20 07:02:59
回答 1查看 67关注 0票数 1

我不明白这一刻:

https://tc39.github.io/ecma262/#sec-function-definitions-runtime-semantics-instantiatefunctionobject

代码语言:javascript
复制
With parameter scope.

FunctionDeclaration: function BindingIdentifier(FormalParameters) {FunctionBody}
1. If the function code for FunctionDeclaration is strict mode code, let strict 
be true. Otherwise let strict be false.
2. Let name be StringValue of BindingIdentifier.
3. Let F be FunctionCreate(Normal, FormalParameters, FunctionBody, scope, strict).
4. Perform MakeConstructor(F).
5. Perform SetFunctionName(F, name).
6. Return F.`

什么等于作用域(查看FunctionCreate)?的参数)在ECMAScript中,没有一个关于范围的词。什么意思:With parameter scope.

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-12-20 07:53:10

这意味着InstantiateFunctionObject算法有一个参数,该参数随后被命名为“作用域”。当应用该过程时,将传递一个值,例如

fo是使用参数lexEnvf执行InstantiateFunctionObject的结果。

一般来说,作用域是指定义函数的词法环境,它将结束。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47900458

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档