-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathspec.emu
More file actions
133 lines (119 loc) · 6.21 KB
/
Copy pathspec.emu
File metadata and controls
133 lines (119 loc) · 6.21 KB
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
125
126
127
128
129
130
131
132
133
<!doctype html>
<meta charset="utf8">
<link rel="stylesheet" href="./spec.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<script src="./spec.js"></script>
<pre class="metadata">
title: Error code property
stage: 1
contributors: James M Snell
</pre>
<emu-clause id="sec-error-objects">
<h1>Error Objects</h1>
<emu-clause id="sec-error-constructor">
<h1>The Error Constructor</h1>
<emu-clause id="sec-error-message">
<h1>Error ( _message_ [ , _options_ ] )</h1>
<p>This function performs the following steps when called:</p>
<emu-alg>
1. If NewTarget is *undefined*, let _newTarget_ be the active function object; else let _newTarget_ be NewTarget.
1. Let _O_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Error.prototype%"*, « [[ErrorData]] »).
1. If _message_ is not *undefined*, then
1. Let _msg_ be ? ToString(_message_).
1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"message"*, _msg_).
1. <del>Perform ? InstallErrorCause(_O_, _options_).</del>
1. <ins>Perform ? InstallErrorOwnProperties(_O_, _options_).</ins>
1. Return _O_.
</emu-alg>
</emu-clause>
</emu-clause>
<emu-clause id="sec-nativeerror-object-structure">
<h1>_NativeError_ Object Structure</h1>
<emu-clause id="sec-nativeerror-constructors">
<h1>The _NativeError_ Constructors</h1>
<emu-clause id="sec-nativeerror">
<h1>_NativeError_ ( _message_ [ , _options_ ] )</h1>
<p>Each _NativeError_ function performs the following steps when called:</p>
<emu-alg>
1. If NewTarget is *undefined*, let _newTarget_ be the active function object; else let _newTarget_ be NewTarget.
1. Let _O_ be ? OrdinaryCreateFromConstructor(_newTarget_, <code>"%<var>NativeError</var>.prototype%"</code>, « [[ErrorData]] »).
1. If _message_ is not *undefined*, then
1. Let _msg_ be ? ToString(_message_).
1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"message"*, _msg_).
1. <del>Perform ? InstallErrorCause(_O_, _options_).</del>
1. <ins>Perform ? InstallErrorOwnProperties(_O_, _options_).</ins>
1. Return _O_.
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>
<emu-clause id="sec-aggregate-error-objects">
<h1>AggregateError Objects</h1>
<emu-clause id="sec-aggregate-error-constructor">
<h1>The AggregateError Constructor</h1>
<emu-clause id="sec-aggregate-error">
<h1>AggregateError ( _errors_, _message_ [ , _options_ ] )</h1>
<p>This function performs the following steps when called:</p>
<emu-alg>
1. If NewTarget is *undefined*, let _newTarget_ be the active function object; else let _newTarget_ be NewTarget.
1. Let _O_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%AggregateError.prototype%"*, « [[ErrorData]] »).
1. If _message_ is not *undefined*, then
1. Let _msg_ be ? ToString(_message_).
1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"message"*, _msg_).
1. <del>Perform ? InstallErrorCause(_O_, _options_).</del>
1. <ins>Perform ? InstallErrorOwnProperties(_O_, _options_).</ins>
1. Let _errorsList_ be ? IteratorToList(? GetIterator(_errors_, ~sync~)).
1. Perform ! DefinePropertyOrThrow(_O_, *"errors"*, PropertyDescriptor { [[Configurable]]: *true*, [[Enumerable]]: *false*, [[Writable]]: *true*, [[Value]]: CreateArrayFromList(_errorsList_) }).
1. Return _O_.
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>
<emu-clause id="sec-suppressed-error-objects">
<h1>SuppressedError Objects</h1>
<emu-clause id="sec-suppressed-error-constructor">
<h1>The SuppressedError Constructor</h1>
<emu-clause id="sec-suppressed-error">
<h1>SuppressedError ( _error_, _suppressed_, _message_ [ , _options_ ] )</h1>
<p>This function performs the following steps when called:</p>
<emu-alg>
1. If NewTarget is *undefined*, let _newTarget_ be the active function object; else let _newTarget_ be NewTarget.
1. Let _O_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%SuppressedError.prototype%"*, « [[ErrorData]] »).
1. If _message_ is not *undefined*, then
1. Let _messageString_ be ? ToString(_message_).
1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"message"*, _messageString_).
1. <del>Perform ? InstallErrorCause(_O_, _options_).</del>
1. <ins>Perform ? InstallErrorOwnProperties(_O_, _options_).</ins>
1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"error"*, _error_).
1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"suppressed"*, _suppressed_).
1. Return _O_.
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>
<emu-clause id="sec-error-objects-abstract-operations">
<h1>Abstract Operations for Error Objects</h1>
<emu-clause id="sec-installerrorownproperties" type="abstract operation">
<h1>
<ins>InstallErrorOwnProperties (
_O_: an Object,
_options_: an ECMAScript language value,
): either a normal completion containing ~unused~ or a throw completion</ins>
</h1>
<dl class="header">
<dt>description</dt>
<dd><ins>It is used to create *"cause"* and *"code"* properties on _O_ when the corresponding properties are present on _options_.</ins></dd>
</dl>
<emu-alg>
1. <ins>If _options_ is an Object, then</ins>
1. <ins>If ? HasProperty(_options_, *"cause"*) is *true*, then</ins>
1. <ins>Let _cause_ be ? Get(_options_, *"cause"*).</ins>
1. <ins>Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"cause"*, _cause_).</ins>
1. <ins>If ? HasProperty(_options_, *"code"*) is *true*, then</ins>
1. <ins>Let _code_ be ? Get(_options_, *"code"*).</ins>
1. <ins>Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"code"*, _code_).</ins>
1. <ins>Return ~unused~.</ins>
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>