« Bugzilla Issues Index

#489 — Inconsistent language across Standard Built-­in ECMAScript Object APIs

Some API instructions read as follows:

"Let  O  be  the  result  of  calling  ToObject  passing  the  this  value  as  the  argument. "

Whereas others read as

"Let  cooked  be  ToObject(callSite)."
"Let  raw  be  ToObject(rawValue)."

As seen in String.raw

I'll continue to look for other occurrences of the language

"Let  S  be  the  result  of  calling  ToString,  giving  it  the  this  value  as  its  argument. "

Yes, going back to ES5, the parenthesized form is generally used when the argument is a "variable" and the sentence form is used when the argument needs to be described with a phrase, such as "the this value".

I'm not sure that ToObject(the this value) would be preferable to to "passing the this value..."

I'm not sure it would be either - what about the other way?

"Let cooked be the result of calling ToObject, passing callSite as the argument"

pretty sure these have now all been converted to the (this Object) form

Yes, I have not seen the other form in a very long time