Question about Array.prototype.slice

# Rick Waldron (14 years ago)

A little different then the usual fare...

When interpreting (for the sake of implementation) how the arguments of Array.prototype.slice should be handled: is it safe to assume that arguments may not be defined and that all implementations are expected to handle this the same way, as specified by 15.4.4.9? Put another way - no part of Array.prototype.slice's argument handling could be "mis-interpreted" by an implementor, without being considered a bug, correct?

I apologize if this has an "obvious" answer and I believe it does, I'm just hoping to get confirmation.

Thanks in advance.

# Rick Waldron (14 years ago)

Sorry, I meant 15.4.4.10

# Gavin Barraclough (14 years ago)

I believe behaviour is defined by the fourth paragraph of chapter 15:

"Unless otherwise specified in the description of a particular function, if a function or constructor described in this clause is given fewer arguments than the function is specified to require, the function or constructor shall behave exactly as if it had been given sufficient additional arguments, each such argument being the undefined value."

The missing arguments are treated as undefined, and ToUint32/ToInteger both convert undefined to 0.

# Rick Waldron (14 years ago)

Thank you