• kittyE
    2020-01-01
    var arr = []
    var x = 100
    arr[0] = eval
    (arr[0])(x)

    属性引用仍然是间接调用,我这样理解对吗
    展开

    作者回复: 是的。

    
     1
  • K4SHIFZ
    2020-02-05
    规范18.2.1.1章:
    Runtime Semantics: PerformEval ( x, evalRealm, strictCaller, direct )
    ...
    12.NOTE: If direct is true, ctx will be the execution context that performed the direct eval. If direct is false, ctx will be the execution context for the invocation of the eval function.
    13.If direct is true, then
        Let lexEnv be NewDeclarativeEnvironment(ctx's LexicalEnvironment).
        Let varEnv be ctx's VariableEnvironment.
    14.Else,
        Let lexEnv be NewDeclarativeEnvironment(evalRealm.[[GlobalEnv]]).
        Let varEnv be evalRealm.[[GlobalEnv]].
    15.If strictEval is true, set varEnv to lexEnv.
    ...
    展开
    
    
  • qqq
    2020-01-02
    (0, eval)('this.eval("b = 1")')

    作者回复: 这个可没有被豁免,"b = 1"仍然是被间接调用的eval执行的。

    
    
  • 行问
    2020-01-01
    2020 年好!

    立一个 flag,今年要把您的书和专栏学习 2 次,不是阅读,是学习。虽然有很多的不懂,持续学习,不断积累。

    也公布下本年度的 flag,有兴趣的小伙伴可以来共勉:2020 年做到 80% 以上的每一天 5:28 起床、23:00 前睡觉(2019 年只做到大概 50%,惭愧)

    作者回复: ...... 给新年计划点赞!

    我已经保持大概(或至少)20年的习惯,大概是每天3:00前后睡了。

    不过这不是好习惯,不值得推广……

    
    
我们在线,来聊聊吧