V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
rabbbit
V2EX  ›  问与答

[ECMAScript] Let func be the function whose [[Call]] internal method initiated execution of code 是啥意思?

  •  
  •   rabbbit · Nov 13, 2018 · 1251 views
    This topic created in 2734 days ago, the information mentioned may be changed or developed.

    http://ecma-international.org/ecma-262/5.1/#sec-10.5
    第 10.5 节
    Let func be the function whose [[Call]] internal method initiated execution of code

    这句是啥意思?
    是令 func 为调用 F 内部方法[[call]](func = F.[[call]])的结果吗?

    另外,求推荐个靠谱的前端交流群

    Supplement 1  ·  Dec 2, 2018
    这个 func 就是被调用的函数对象本身
    见步骤 7,调用抽象操作 CreateArgumentsObject 创建 arguments
    ```
    Let argsObj be the result of calling the abstract operation CreateArgumentsObject (10.6) passing func, names, args, env and strict as arguments.
    ```
    再往下看 10.6 中关于 CreateArgumentsObject 的描述之步骤 13
    如果是非严格模式,调用内部方法 DefineOwnProperty("callee")
    ```
    If strict is false, then
    Call the [[DefineOwnProperty]] internal method on obj passing "callee", the property descriptor {[[Value]]: func, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true}, and false as arguments.
    ```

    已经很明显了,argument.callee 指向的是当前所在函数
    4 replies    2018-11-13 11:17:17 +08:00
    robinlovemaggie
        1
    robinlovemaggie  
       Nov 13, 2018   ❤️ 1
    func 定性为关键字,用来函数初始化。
    mcfog
        2
    mcfog  
       Nov 13, 2018 via Android   ❤️ 1
    你的理解里的这个大 F 是哪里冒出来的?
    令 func 为一个 function,其[[call]]内部方法启动(相应)代码的执行过程

    这更多是一个中学英语的问题
    mcfog
        3
    mcfog  
       Nov 13, 2018 via Android
    用伪代码写的话是
    declaration-binding.func = new function({ [[call]]() { execute code } })
    rabbbit
        4
    rabbbit  
    OP
       Nov 13, 2018
    @mcfog
    翻译成中文也没看懂这步在干啥...
    不过谢啦
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5365 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 08:20 · PVG 16:20 · LAX 01:20 · JFK 04:20
    ♥ Do have faith in what you're doing.