es-howto icon indicating copy to clipboard operation
es-howto copied to clipboard

extraneous "!" in the text?

Open Li-YangZhong opened this issue 5 years ago • 5 comments

The "!" is shown in the section below:


`When Boolean is called with argument value, the following steps are taken:

Let b be ! ToBoolean(value).

If NewTarget is undefined, return b.

Let O be ? OrdinaryCreateFromConstructor(NewTarget, "%BooleanPrototype%", « [[BooleanData]] »).

Set O.[[BooleanData]] to b.

Return O.`


However, the following section seems to indicate that there is not a "!" in the section above and the ECMA-262(2019 edition) don't have a "!" in there either. I think the "!" should be removed.


Step 1 casts value (the function argument) to a Boolean value. Interestingly there isn’t a ? or ! shorthand for this step, but usually not having a Completion Record shorthand means the same thing as !. So step 1 cannot throw an exception.


Li-YangZhong avatar May 23 '20 11:05 Li-YangZhong

Indeed. There has been recently a few clean-ups on the usage of these shorthands in the spec. See https://github.com/tc39/ecma262/pull/1622 and https://github.com/tc39/ecma262/pulls?q=label%3A%22completion+records%22.

TimothyGu avatar May 24 '20 02:05 TimothyGu

That's a long winded way of saying: I'd appreciate a pull request :)

TimothyGu avatar May 24 '20 02:05 TimothyGu

I'm a beginner contributor and I was looking for easy issues to fix when I found this one. I can take care of the ! removal (In spite I don't know what are you talking about there)

uaparicio avatar May 24 '20 03:05 uaparicio

https://github.com/TimothyGu/es-howto/pull/14

uaparicio avatar May 24 '20 03:05 uaparicio