4 ms·
In the proposal text, what's the meaning of the '?' and '!' - for example in "Let O be ? ToObject(this value)"
by pedrow 5y ago
In the proposal text, what's the meaning of the '?' and '!' - for example in "Let O be ? ToObject(this value)"
- IainIreland 5y agoRoughly speaking, '?' means that the operation might throw an exception, which should be propagated if thrown, and '!' means that the operation should never fail. (In Rust terms, '? ToObject(this value)" -> "ToObject(thisValue)?", and "! ToObject(this value)" -> "ToObject(thisValue).unwrap()".) See: https://tc39.es/ecma262/multipage/notational-conventions.html#sec-returnifabrupt-shorthands https://tc39.es/ecma262/multipage/notational-conventions.htm...