diff --git a/index.bs b/index.bs index c625067..673f93c 100644 --- a/index.bs +++ b/index.bs @@ -266,20 +266,20 @@ The name getter steps are to return [= The remove(|options|) 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. @@ -307,6 +307,8 @@ The remove(|options|) 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.