Skip to content

Make transactions inactive during clone #310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 26, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make transactions inactive during clone
  • Loading branch information
inexorabletash committed Nov 26, 2019
commit 216e535f804da0395b5465dc999c252e7b569e28
24 changes: 16 additions & 8 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2983,7 +2983,7 @@ To <dfn>add or put</dfn> with |handle|, |value|, |key|, and |no-overwrite flag|,

1. Let |targetRealm| be a user-agent defined [=Realm=].

1. Let |clone| be a [=clone=] of |value| in |targetRealm|.
1. Let |clone| be a [=clone=] of |value| in |targetRealm| during |transaction|.
Rethrow any exceptions.

<details class=note>
Expand Down Expand Up @@ -4680,7 +4680,7 @@ invoked, must run these steps:

1. Let |targetRealm| be a user-agent defined [=Realm=].

1. Let |clone| be a [=clone=] of |value| in |targetRealm|.
1. Let |clone| be a [=clone=] of |value| in |targetRealm| during |transaction|.
Rethrow any exceptions.

<details class=note>
Expand Down Expand Up @@ -5528,8 +5528,7 @@ To <dfn>abort an upgrade transaction</dfn> with |transaction|, run these steps:

<div class=algorithm>

To <dfn>fire a success event</dfn> at a |request|,
the implementation must run these steps:
To <dfn>fire a success event</dfn> at a |request|, run these steps:

1. Let |event| be the result of [=creating an event=] using {{Event}}.

Expand Down Expand Up @@ -5568,8 +5567,7 @@ the implementation must run these steps:

<div class=algorithm>

To <dfn>fire an error event</dfn> at a |request|,
the implementation must run these steps:
To <dfn>fire an error event</dfn> at a |request|, run these steps:

1. Let |event| be the result of [=creating an event=] using {{Event}}.

Expand Down Expand Up @@ -5621,13 +5619,23 @@ the implementation must run these steps:

<div class=algorithm>

To make a <dfn>clone</dfn> of |value| in |targetRealm|,
the implementation must run these steps:
To make a <dfn>clone</dfn> of |value| in |targetRealm| during |transaction|,
run these steps:

1. [=/Assert=]: |transaction|'s [=transaction/state=] is [=transaction/active=].

1. Set |transaction|'s [=transaction/state=] to [=transaction/inactive=].

<aside class=note>
The [=/transaction=] is made [=transaction/inactive=] so that getters or other side effects triggered by the cloning operation are unable to make additional requests against the transaction.
</aside>

1. Let |serialized| be [=?=] <a abstract-op>StructuredSerializeForStorage</a>(|value|).

1. Let |clone| be [=?=] <a abstract-op>StructuredDeserialize</a>(|serialized|, |targetRealm|).

1. Set |transaction|'s [=transaction/state=] to [=transaction/active=].

1. Return |clone|.

</div>
Expand Down