Skip to content

Commit

Permalink
use framework laid out in #95
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sully committed Feb 15, 2023
1 parent 9f3c5bf commit aa0b505
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -266,20 +266,20 @@ The <dfn attribute for=FileSystemHandle>name</dfn> getter steps are to return [=
The <dfn method for=FileSystemHandle>remove(|options|)</dfn> method steps are:

1. Let |result| be [=a new promise=].
1. Let |entry| be [=this=]'s [=FileSystemHandle/entry=].
1. Run these steps [=in parallel=]:
1. Let |access| be the result of running [=this=]'s
[=FileSystemHandle/entry=]'s [=file system entry/request access=] given
"`readwrite`".
1. If |access| is not "{{PermissionState/granted}}", reject |result| with a
"{{NotAllowedError}}" {{DOMException}} and abort.
1. Let |access| be the result of running |entry|'s
[=file system entry/request access=] given "`readwrite`".
1. If |access| is not "{{PermissionState/granted}}":
1. [=Queue a storage task=] given |entry|'s [=relevant global object=] to
[=/reject=] |result| with a "{{NotAllowedError}}" {{DOMException}}.
1. Abort these steps.

1. Let |entry| be [=this=]'s [=FileSystemHandle/entry=].
1. Let |lockResult| be the result of [=file entry/lock/take|taking a lock=]
with "`exclusive`" on |entry|.
1. If |lockResult| is false, [=reject=] |result| with a
"{{NoModificationAllowedError}}" {{DOMException}} and abort.
1. Let |lockResultAlgorithm| be an algorithm which takes a |lockResult| and
runs these steps:
1. If |lockResult| is "`failure`", [=/reject=] |result| with a
"{{NoModificationAllowedError}}" {{DOMException}} and abort.

1. [=Queue a task=] on the [=storage task source=] to run these steps:
1. If |entry| does not exist in the underlying file system, [=/reject=]
|result| with a "{{NotFoundError}}" {{DOMException}} and abort.

Expand Down Expand Up @@ -307,6 +307,8 @@ The <dfn method for=FileSystemHandle>remove(|options|)</dfn> method steps are:
Issue(68): Better specify what possible exceptions this could throw.
1. [=/Resolve=] |result| with `undefined`.

1. [=file entry/lock/take|Take a lock=] with "`exclusive`" on |entry| and with
|lockResultAlgorithm|.
1. Return |result|.

Issue(39): Better specify what happens to a removed handle.
Expand Down

0 comments on commit aa0b505

Please sign in to comment.