P. 1
JavaScript Language Specification(ECMA-262)

JavaScript Language Specification(ECMA-262)

|Views: 59|Likes:
Publicado porrayaspnet
http://rayaspnet.blogspot.com/

http://rayaspnet.blogspot.com/

More info:

Published by: rayaspnet on Jun 06, 2011
Direitos Autorais:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

04/06/2012

pdf

text

original

When Array is called as part of a new expression, it is a constructor: it initialises the newly created object.

15.4.2.1 new Array ( [ item0 [ , item1 [ , … ] ] ] )

This description applies if and only if the Array constructor is given no arguments or at least two arguments.

The [[Prototype]] internal property of the newly constructed object is set to the original Array prototype object,
the one that is the initial value of Array.prototype (15.4.3.1).

The [[Class]] internal property of the newly constructed object is set to "Array".

The [[Extensible]] internal property of the newly constructed object is set to true.

The length property of the newly constructed object is set to the number of arguments.

The 0 property of the newly constructed object is set to item0 (if supplied); the 1 property of the newly
constructed object is set to item1 (if supplied); and, in general, for as many arguments as there are, the k
property of the newly constructed object is set to argument k, where the first argument is considered to be
argument number 0. These properties all have the attributes {[[Writable]]: true, [[Enumerable]]: true,
[[Configurable]]: true}.

15.4.2.2 new Array (len)

The [[Prototype]] internal property of the newly constructed object is set to the original Array prototype object,
the one that is the initial value of Array.prototype (15.4.3.1). The [[Class]] internal property of the newly
constructed object is set to "Array". The [[Extensible]] internal property of the newly constructed object is set
to true.

If the argument len is a Number and ToUint32(len) is equal to len, then the length property of the newly
constructed object is set to ToUint32(len). If the argument len is a Number and ToUint32(len) is not equal to len,
a RangeError exception is thrown.

If the argument len is not a Number, then the length property of the newly constructed object is set to 1 and
the 0 property of the newly constructed object is set to len with attributes {[[Writable]]: true, [[Enumerable]]:
true, [[Configurable]]: true}..

You're Reading a Free Preview

Descarregar
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->