-
Notifications
You must be signed in to change notification settings - Fork 68
/
x15.html
124 lines (123 loc) · 6.48 KB
/
x15.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!DOCTYPE html>
<html class="split chapter"><head><meta charset="utf-8"><title>15 Standard Built-in ECMAScript Objects # Ⓣ Ⓔ ① Ⓐ — Annotated ES5</title><link rel="stylesheet" href="style.css"><link href="x14.html" title="14 Program " rel="prev">
<link href="spec.html" title="TOC" rel="index">
<link href="x15.1.html" title="15.1 The Global Object " rel="next">
</head><body><div class="head">
<h2 id="top">Annotated ECMAScript 5.1 <span id="timestamp"></span></h2>
<div id="mascot-treehouse">
<img id="mascot" align="left" src="js-mascot.svg" alt=""><img id="bubble" src="bubble.svg" alt=""></div>
<p id="slogan">‟Ex igne vita”</p>
<div id="annotations"></div>
<script src="timestamp.js"></script></div>
<nav>
<a href="x14.html">← 14 Program </a> –
<a href="spec.html" class="toc-nav">TOC</a> –
<a href="x15.1.html">15.1 The Global Object →</a>
</nav>
<h2 id="x15">15 Standard Built-in ECMAScript Objects <a href="#x15">#</a> <a href="#x15-toc" class="bak">Ⓣ</a> <b class="erra">Ⓔ</b> <b class="rev1">①</b> <b class="anno">Ⓐ</b></h2>
<p>
There
are certain built-in objects available whenever an ECMAScript
program begins execution. One, the <a href="x15.1.html#x15.1" class="term-ref">global object</a>, is part of the
<a href="x10.html#x10.2">lexical environment</a> of the executing program. Others are accessible
as initial properties of the <a href="x15.1.html#x15.1" class="term-ref">global object</a>.</p>
<p>
Unless
specified otherwise, the [[Class]] internal property of a built-in
object is <code><b>"Function"</b></code>
if that built-in object has a [[Call]] internal property, or
<code><b>"Object"</b></code>
if that built-in object does not have a [[Call]] internal property.
Unless specified otherwise, the [[Extensible]] internal property of
a built-in object initially has the value <b>true</b>.</p>
<p>
Many
built-in objects are functions: they can be invoked with arguments.
Some of them furthermore are constructors: they are functions
intended for use with the <code><b>new</b></code>
operator. For each built-in function, this specification describes
the arguments required by that function and properties of the
Function object. For each built-in constructor, this specification
furthermore describes properties of the prototype object of that
constructor and properties of specific object instances returned by
a <code><b>new</b></code> expression
that invokes that constructor.</p>
<p>
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 <b>undefined</b>
value.</p>
<p>
Unless
otherwise specified in the description of a particular function, if
a function or constructor described in this clause is given more
arguments than the function is specified to allow, the extra
arguments are evaluated by the call and then ignored by the
function. However, an implementation may define implementation
specific behaviour relating to such arguments as long as the
behaviour is not the throwing of a <b><a href="x15.11.html#x15.11.6.5" class="term-ref">TypeError</a></b> exception that
is predicated simply on the presence of an extra argument.</p>
<p><b class="note">NOTE</b> Implementations
that add additional capabilities to the set of built-in functions
are encouraged to do so by adding new functions rather than adding
new parameters to existing functions.</p>
<p>
Every
built-in function and every built-in constructor has the
<a href="x15.3.html#x15.3.4">Function prototype object</a>, which is the initial value of the expression
<code><b><a href="x15.3.html#x15.3.3.1">Function.prototype</a></b></code>
(<a href="x15.3.html#x15.3.4">15.3.4</a>), as the value of its [[Prototype]] internal property.</p>
<p>
Unless
otherwise specified every built-in prototype object has the
<a href="x15.3.html#x15.3.4">Object prototype object</a>, which is the initial value of the expression
<code><b><a href="x15.2.html#x15.2.3.1">Object.prototype</a></b></code>
(<a href="x15.2.html#x15.2.4">15.2.4</a>), as the value of its [[Prototype]] internal property,
except the Object prototype object itself.</p>
<p>
None
of the built-in functions described in this clause that are not
constructors shall implement the [[Construct]] internal method
unless otherwise specified in the description of a particular
function. None of the built-in functions described in this clause
shall have a <code><b>prototype</b></code>
property unless otherwise specified in the description of a
particular function.</p>
<p>
This
clause generally describes distinct behaviours for when a
constructor is “called as a function” and for when it is “called
as part of a <b>new</b> expression”. The “called as a function”
behaviour corresponds to the invocation of the constructor’s
[[Call]] internal method and the “called as part of a new
expression” behaviour corresponds to the invocation of the
constructor’s [[Construct]] internal method.
</p>
<p>
Every
built-in Function object described in this clause—whether as a
constructor, an ordinary function, or both—has a <code><b>length</b></code>
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.</p>
<p><b class="note">NOTE</b> For
example, the Function object that is the initial value of the <code>slice</code>
property of the String prototype object is described under the
subclause heading “String.prototype.slice (start, end)” which
shows the two named arguments start and end; therefore the value of
the <code>length</code> property of
that Function object is <code>2</code>.</p>
<p>
In
every case, the <code><b>length</b></code>
property of a built-in Function object described in this clause has
the attributes { [[Writable]]: <b>false</b>, [[Enumerable]]:
<b>false</b>, [[Configurable]]: <b>false</b> }. Every other property
described in this clause has the attributes { [[Writable]]: <b>true</b>,
[[Enumerable]]: <b>false</b>, [[Configurable]]: <b>true</b> } unless
otherwise specified.</p>
</body><script src="anno.js"></script></html>