archives

« Bugzilla Issues Index

#2772 — 20.1.3.6 Number.prototype.toString: Remove brackets in function definition or add explicit length


20.1.3.6 Number.prototype.toString ( [ radix ] ).


Change the function definition to "Number.prototype.toString(radix)" or explicitly define the function arity to be 1.

Note: The bracket notation was added in ES5, `Number.prototype.toString.length` is 1 in all engines (Nashorn, JSC, IE11, SpiderMonkey, V8).


this is covered by clause 17 which says:

"Every built-in Function object, including constructors, has a length property whose value is an integer. Unless otherwise specified, this value is equal to the largest number of named arguments shown in the subclause headings for the function description, including optional parameters. However, rest parameters shown using the form “...name” are not included in the default argument count."

I just added the last sentence in rev25

So, the heading of 20.1.3.6 doesn't need to change.

fixed in rev25 editor's draft


(In reply to comment #1)
> this is covered by clause 17 which says:
>

Ah yes, I confused it with the length property of user defined ECMAScript function objects. Does this is also mean the explicit length for various Date.prototype.* methods is actually redundant?


fixed in rev25 editor's draft