ecmascript - ecma标准文档阅读问题,一个隐藏操作前面带一个问号表示什么意思?

查看:199
本文介绍了ecmascript - ecma标准文档阅读问题,一个隐藏操作前面带一个问号表示什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

https://tc39.github.io/ecma262/#sec-bitwise-not-operator

    Runtime Semantics: Evaluation#
    
    UnaryExpression:~UnaryExpression
    Let expr be the result of evaluating UnaryExpression.
    Let oldValue be ? ToInt32(? GetValue(expr)).
    Return the result of applying bitwise complement to oldValue. The result is a signed 32-bit integer.
    

这里面 ? GetValue(expr) 前面为什么要带个问号?表示什么意思? ? ToInt32前面也带了。

解决方案

自己找到了

https://tc39.github.io/ecma262/#sec-algorithm-conventions

    Abstract operations referenced using the functional application style and the method application style that are prefixed by ? indicate that ReturnIfAbrupt should be applied to the resulting Completion Record. For example, ? operationName() is equivalent to ReturnIfAbrupt(operationName()). Similarly, ? someValue.operationName() is equivalent to ReturnIfAbrupt(someValue.operationName()).

这篇关于ecmascript - ecma标准文档阅读问题,一个隐藏操作前面带一个问号表示什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆