generated from tc39/template-for-proposals
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathspec.emu
52 lines (46 loc) · 2.36 KB
/
spec.emu
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
<!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 Stack Accessor
stage: 2
contributors: Jordan Harband, Mark Miller
</pre>
<emu-clause id="sec-fundamental-objects" number="20">
<h1>Fundamental Objects</h1>
<emu-clause id="sec-error-objects" number="5">
<h1>Error Objects</h1>
<emu-clause id="sec-properties-of-the-error-prototype-object" number="3">
<h1>Properties of the Error Prototype Object</h1>
<emu-clause id="sec-get-error.prototype-stack">
<h1>Error.prototype.stack</h1>
<p>`Error.prototype.stack` is an accessor property with attributes { [[Enumerable]]: *false*, [[Configurable]]: *true* }. The [[Get]] and [[Set]] attributes are defined as follows:</p>
<emu-clause id="sec-get-error.prototype.stack">
<h1>get Error.prototype.stack</h1>
<p>The value of the [[Get]] attribute is a built-in function that requires no arguments. It performs the following steps when called:</p>
<emu-alg>
1. Let _E_ be the *this* value.
1. If _E_ is not an Object, throw a *TypeError* exception.
1. If _E_ does not have an [[ErrorData]] internal slot, return *undefined*.
1. Return an implementation-defined string that represents the stack trace of _E_.
</emu-alg>
</emu-clause>
<emu-clause id="sec-set-error.prototype.stack">
<h1>set Error.prototype.stack</h1>
<p>The value of the [[Set]] attribute is a built-in function that takes an argument _v_. It performs the following steps when called:</p>
<emu-alg>
1. Let _E_ be the *this* value.
1. If _E_ is not an Object, throw a *TypeError* exception.
1. Let _numberOfArgs_ be the number of arguments passed to this function call.
1. If _numberOfArgs_ is 0, throw a *TypeError* exception.
1. If _E_ does not have an [[ErrorData]] internal slot, return *undefined*.
1. Perform ? SetterThatIgnoresPrototypeProperties(*this* value, %Error.prototype%, *"stack"*, _v_).
1. Return *undefined*.
</emu-alg>
</emu-clause>
</emu-clause>
</emu-clause>
</emu-clause>
</emu-clause>