本文介绍了什么是直接参考?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

严格模式规则之一()声明:

One of the strict mode rules (Annex C) states:

所以在这段代码中:

delete x

x 是一个参考。 (我知道这是因为)。但这是直接参考吗?

x is a reference. (I know this because "the result of evaluating an Identifier is always a value of type Reference"). But is it a direct reference?

还有其他种类的参考吗?间接引用? (如果没有,那么使用直接一词有什么意义?)

And, are there other kinds of references? Indirect references? (If not, what's the point of using the word "direct" at all?)

推荐答案

是的,有不同种类的参考文献()。成员运营商()例如导致基值 baseReference 的值的引用,我称之为非直接。 直接参考将是标识符参考(,其中基值是环境记录。

Yes, there are different kinds of References (EcmaScript §8.7). The member operators (EcmaScript §11.2.1) for example do result in references whose base value is the value of the baseReference, which I'd call "not direct". A "direct reference" would be an identifier reference (EcmaScript §10.2.2.1, where the base value is an Environment Record.

这篇关于什么是直接参考?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 01:57