Skip to content

Commit 323cf3f

Browse files
Ms2gerdomenic
authored andcommitted
Correctly rethrow exceptions when using Call()
Fixes #207. Note that for now this rethrows exceptions from Map and Set methods; see #207 (comment) for the rationale there and future steps to make it more robust.
1 parent 6bc7d85 commit 323cf3f

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

index.bs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7891,7 +7891,7 @@ objects.
78917891
return <emu-val>undefined</emu-val>.
78927892
1. Otherwise, return the result of performing any steps that were required to be run if the promise was rejected,
78937893
with |reason| as the rejection reason.
7894-
1. Return <a abstract-op>Call</a>({{%PromiseProto_then%}}, |promise|, «|onFulfilled|, |onRejected|»).
7894+
1. Return [=!=] <a abstract-op>Call</a>({{%PromiseProto_then%}}, |promise|, «|onFulfilled|, |onRejected|»).
78957895
</div>
78967896

78977897
<p class="issue">
@@ -11713,7 +11713,7 @@ then the [=function object=] is {{%ArrayProto_forEach%}}.
1171311713
1. Let |callbackWrapper| be a [=built-in function object=] that, when invoked, behaves as follows:
1171411714
1. Let |v| and |k| be the first two arguments passed to the function.
1171511715
1. Let |thisArg| be the <emu-val>this</emu-val> value.
11716-
1. <a abstract-op>Call</a>(|callbackFn|, |thisArg|, «|v|, |k|, |object|»).
11716+
1. Perform [=?=] <a abstract-op>Call</a>(|callbackFn|, |thisArg|, «|v|, |k|, |object|»).
1171711717

1171811718
Note: The |callbackWrapper| function simply calls the incoming |callbackFn|
1171911719
with |object| as the third argument rather than its internal \[[BackingMap]] or \[[BackingSet]] object.
@@ -11725,7 +11725,7 @@ then the [=function object=] is {{%ArrayProto_forEach%}}.
1172511725
</p>
1172611726
1. Let |forEach| be [=?=] <a abstract-op>GetMethod</a>(|backing|, "<code>forEach</code>").
1172711727
1. If |forEach| is <emu-val>undefined</emu-val>, then [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
11728-
1. <a abstract-op>Call</a>(|forEach|, |backing|, «|callbackWrapper|, |thisArg|»).
11728+
1. Perform [=?=] <a abstract-op>Call</a>(|forEach|, |backing|, «|callbackWrapper|, |thisArg|»).
1172911729
1. Return <emu-val>undefined</emu-val>.
1173011730
</div>
1173111731

@@ -11973,7 +11973,7 @@ These additional properties are described in the sub-sections below.
1197311973
1. Let |map| be the {{ECMAScript/Map}} object that is the value of |O|’s \[[BackingMap]] [=internal slot=].
1197411974
1. Let |function| be [=?=] <a abstract-op>GetMethod</a>(|map|, |name|).
1197511975
1. If |function| is <emu-val>undefined</emu-val>, then [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
11976-
1. Return <a abstract-op>Call</a>(|function|, |map|, |arguments|).
11976+
1. Return [=?=] <a abstract-op>Call</a>(|function|, |map|, |arguments|).
1197711977
</div>
1197811978

1197911979

@@ -12057,7 +12057,7 @@ For both of <code class="idl">get</code> and <code class="idl">has</code>, there
1205712057
1. Let |keyArg| be the first argument passed to this function, or <emu-val>undefined</emu-val> if not supplied.
1205812058
1. Let |keyIDL| be the result of [=converted to an IDL value|converting=] |keyArg| to an IDL value of type |keyType|.
1205912059
1. Let |key| be the result of [=converted to ECMAScript values|converting=] |keyIDL| to an ECMAScript value.
12060-
1. Return <a abstract-op>Call</a>(|function|, |map|, «|key|»).
12060+
1. Return [=?=] <a abstract-op>Call</a>(|function|, |map|, «|key|»).
1206112061
</div>
1206212062

1206312063
The value of the [=function object=]’s <code class="idl">length</code> properties is the Number value <emu-val>1</emu-val>.
@@ -12109,7 +12109,7 @@ must exist on |A|’s
1210912109
1. Let |keyArg| be the first argument passed to this function, or <emu-val>undefined</emu-val> if not supplied.
1211012110
1. Let |keyIDL| be the result of [=converted to an IDL value|converting=] |keyArg| to an IDL value of type |keyType|.
1211112111
1. Let |key| be the result of [=converted to ECMAScript values|converting=] |keyIDL| to an ECMAScript value.
12112-
1. Return <a abstract-op>Call</a>(|function|, |map|, «|key|»).
12112+
1. Return [=?=] <a abstract-op>Call</a>(|function|, |map|, «|key|»).
1211312113
</div>
1211412114

1211512115
The value of the [=function object=]’s <code class="idl">length</code> property is the Number value <emu-val>1</emu-val>.
@@ -12146,7 +12146,7 @@ must exist on |A|’s [=interface prototype object=]:
1214612146
1. Let |valueIDL| be the result of [=converted to an IDL value|converting=] |valueArg| to an IDL value of type |valueType|.
1214712147
1. Let |key| be the result of [=converted to ECMAScript values|converting=] |keyIDL| to an ECMAScript value.
1214812148
1. Let |value| be the result of [=converted to ECMAScript values|converting=] |valueIDL| to an ECMAScript value.
12149-
1. [=!=] <a abstract-op>Call</a>(|function|, |map|, «|key|, |value|»).
12149+
1. Perform [=?=] <a abstract-op>Call</a>(|function|, |map|, «|key|, |value|»).
1215012150
1. Return |O|.
1215112151
</div>
1215212152

@@ -12190,7 +12190,7 @@ These additional properties are described in the sub-sections below.
1219012190
1. Let |function| be [=?=] <a abstract-op>GetMethod</a>(|set|, |name|).
1219112191
1. If |function| is <emu-val>undefined</emu-val>,
1219212192
then [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
12193-
1. Return <a abstract-op>Call</a>(|function|, |set|, |arguments|).
12193+
1. Return [=?=] <a abstract-op>Call</a>(|function|, |set|, |arguments|).
1219412194
</div>
1219512195

1219612196

@@ -12272,7 +12272,7 @@ with the following characteristics:
1227212272
1. Let |arg| be the first argument passed to this function, or <emu-val>undefined</emu-val> if not supplied.
1227312273
1. Let |idlValue| be the result of [=converted to an IDL value|converting=] |arg| to an IDL value of type |type|.
1227412274
1. Let |value| be the result of [=converted to ECMAScript values|converting=] |idlValue| to an ECMAScript value.
12275-
1. <a abstract-op>Call</a>(|function|, |set|, «|value|»).
12275+
1. Return [=?=] <a abstract-op>Call</a>(|function|, |set|, «|value|»).
1227612276
</div>
1227712277

1227812278
The value of the [=function object=]’s <code class="idl">length</code> property is a Number value <emu-val>1</emu-val>.
@@ -12305,11 +12305,11 @@ must exist on |A|’s [=interface prototype object=]:
1230512305
1. If |O| is not an object that implements <var ignore>A</var>, then [=ECMAScript/throw=] a {{ECMAScript/TypeError}}.
1230612306
1. Let |set| be the {{ECMAScript/Set}} object that is the value of |O|’s \[[BackingSet]] [=internal slot=].
1230712307
1. Let |type| be the value type specified in the [=setlike declaration=].
12308-
1. Let |function| be [=!=] <a abstract-op>Get</a>(|set|, |name|).
12308+
1. Let |function| be [=?=] <a abstract-op>Get</a>(|set|, |name|).
1230912309
1. Let |arg| be the first argument passed to this function, or <emu-val>undefined</emu-val> if not supplied.
1231012310
1. Let |idlValue| be the result of [=converted to an IDL value|converting=] |arg| to an IDL value of type |type|.
1231112311
1. Let |value| be the result of [=converted to ECMAScript values|converting=] |idlValue| to an ECMAScript value.
12312-
1. Let |result| be [=!=] <a abstract-op>Call</a>(|function|, |set|, «|value|»).
12312+
1. Let |result| be [=?=] <a abstract-op>Call</a>(|function|, |set|, «|value|»).
1231312313
1. If |name| is "delete", then return |result|.
1231412314
1. Otherwise, return |O|.
1231512315
</div>

0 commit comments

Comments
 (0)