Skip to content

Commit

Permalink
update variable case
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sully committed Nov 11, 2022
1 parent 22226d4 commit 5909c98
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ interface FileSystemHandle {
readonly attribute FileSystemHandleKind kind;
readonly attribute USVString name;

Promise<undefined> move(USVString new_entry_name);
Promise<undefined> move(FileSystemDirectoryHandle destination_directory);
Promise<undefined> move(FileSystemDirectoryHandle destination_directory, USVString new_entry_name);
Promise<undefined> move(USVString newEntryName);
Promise<undefined> move(FileSystemDirectoryHandle destinationDirectory);
Promise<undefined> move(FileSystemDirectoryHandle destinationDirectory, USVString newEntryName);

Promise<boolean> isSameEntry(FileSystemHandle other);
};
Expand Down Expand Up @@ -238,22 +238,22 @@ The <dfn attribute for=FileSystemHandle>kind</dfn> getter steps are to return

The <dfn attribute for=FileSystemHandle>name</dfn> getter steps are to return [=this=]'s [=entry/name=].

### The {{FileSystemHandle/move(destination_directory, new_entry_name)|move()}} method ### {#api-filesystemhandle-move}
### The {{FileSystemHandle/move(destinationDirectory, newEntryName)|move()}} method ### {#api-filesystemhandle-move}

<div class="note domintro">
: await |handle| . {{FileSystemHandle/move(new_entry_name)|move}}({ {{USVString}}: |new_entry_name|})
: await |handle| . {{FileSystemHandle/move(newEntryName)|move}}({ {{USVString}}: |newEntryName|})
:: Attempts to rename the entry represented by |handle| to
|new_entry_name| in the underlying file system.
|newEntryName| in the underlying file system.

: await |handle| . {{FileSystemHandle/move(destination_directory)|move}}({ {{FileSystemDirectoryHandle}}: |destination_directory|})
:: Attempts to move the entry represented by |handle| to |destination_directory|,
: await |handle| . {{FileSystemHandle/move(destinationDirectory)|move}}({ {{FileSystemDirectoryHandle}}: |destinationDirectory|})
:: Attempts to move the entry represented by |handle| to |destinationDirectory|,
while keeping its existing name.

: await |handle| . {{FileSystemHandle/move(destination_directory, new_entry_name)|move}}({ {{FileSystemDirectoryHandle}}: |destination_directory|, {{USVString}}: |new_entry_name|})
:: Attempts to move the entry represented by |handle| to |destination_directory|,
as well as renaming to |new_entry_name|.
: await |handle| . {{FileSystemHandle/move(destinationDirectory, newEntryName)|move}}({ {{FileSystemDirectoryHandle}}: |destinationDirectory|, {{USVString}}: |newEntryName|})
:: Attempts to move the entry represented by |handle| to |destinationDirectory|,
as well as renaming to |newEntryName|.

If |destination_directory| is not on the same underlying filesystem, this move
If |destinationDirectory| is not on the same underlying filesystem, this move
is not guaranteed to be atomic and will involve duplicating data.

For files or directories with multiple hardlinks or symlinks, the entry
Expand All @@ -266,7 +266,7 @@ The <dfn attribute for=FileSystemHandle>name</dfn> getter steps are to return [=
</div>

<div algorithm>
The <dfn method for=FileSystemHandle>move({{FileSystemDirectoryHandle}}: |destination_directory|, {{USVString}}: |new_entry_name|)</dfn>
The <dfn method for=FileSystemHandle>move({{FileSystemDirectoryHandle}}: |destinationDirectory|, {{USVString}}: |newEntryName|)</dfn>
method steps are:

1. Let |result| be [=a new promise=].
Expand All @@ -275,28 +275,28 @@ method steps are:
1. If |entry| is the [=root directory of the origin private file system=]:
1. [=/Reject=] |result| with an "{{NoModificationAllowedError}}" {{DOMException}}
and abort.
1. Let |new_name| be |new_entry_name| if specified, otherwise [=entry/name=].
If |new_name| is invalid or deemed too dangerous, user agents should
1. Let |newName| be |newEntryName| if specified, otherwise [=entry/name=].
If |newName| is invalid or deemed too dangerous, user agents should
sanitize it, similar to the sanitization done when fetching something
<a spec=html>as a download</a>, or [=/reject=] |result| with a
{{TypeError}} and abort.
1. Let |new_directory| be |destination_directory| if specified, otherwise [=entry/parent=].
If |new_directory| does not exist, [=/reject=] |result| with a
1. Let |newDirectory| be |destinationDirectory| if specified, otherwise [=entry/parent=].
If |newDirectory| does not exist, [=/reject=] |result| with a
"{{NotFoundError}}" {{DOMException}} and abort.
1. Let |destination_entry| be an [=/entry=] in |new_directory|'s [=directory entry/children=].
1. Set |destination_entry|'s [=entry/name=] to |new_name|.
1. If |entry| is [=the same as=] |destination_entry|,
1. Let |destinationEntry| be an [=/entry=] in |newDirectory|'s [=directory entry/children=].
1. Set |destinationEntry|'s [=entry/name=] to |newName|.
1. If |entry| is [=the same as=] |destinationEntry|,
[=/resolve=] |result| with `undefined`.
1. If |destination_entry| exists in the underlying file system:
1. If |destinationEntry| exists in the underlying file system:
1. [=/Reject=] |result| with an "{{InvalidModificationError}}" {{DOMException}}
and abort.

1. Let |accessSource| be the result of running |entry|'s
[=entry/request access=] given "`readwrite`".
1. If |accessSource| is not "{{PermissionState/granted}}", reject |result| with a
"{{NotAllowedError}}" {{DOMException}} and abort.
1. If |new_directory| is not [=entry/parent=]:
1. Let |accessDest| be the result of running |new_directory|'s
1. If |newDirectory| is not [=entry/parent=]:
1. Let |accessDest| be the result of running |newDirectory|'s
[=entry/request access=] given "`readwrite`".
1. If |accessDest| is not "{{PermissionState/granted}}", reject |result| with a
"{{NotAllowedError}}" {{DOMException}} and abort.
Expand All @@ -306,33 +306,33 @@ method steps are:
1. If |lockResultSource| is false, [=reject=] |result| with a
"{{NoModificationAllowedError}}" {{DOMException}} and abort.
1. Let |lockResultDestination| be the result of [=file entry/lock/take|taking a lock=]
with "`exclusive`" on |destination_entry|.
with "`exclusive`" on |destinationEntry|.
1. If |lockResultDestination| is false, [=reject=] |result| with a
"{{NoModificationAllowedError}}" {{DOMException}} and abort.

1. If |new_directory| does not exist in the underlying file system:
1. If |newDirectory| does not exist in the underlying file system:
1. [=/Reject=] |result| with a "{{NotFoundError}}" {{DOMException}} and abort.
1. If |entry| does not exist in the underlying file system:
1. [=/Reject=] |result| with a "{{NotFoundError}}" {{DOMException}} and abort.
1. If |entry| is a [=directory entry=]:
1. If |entry| is in the Origin Private File System and |destination_entry| is not:
1. If |entry| is in the Origin Private File System and |destinationEntry| is not:
1. [=set/For each=] of |entry|'s [=directory entry/children=]:
1. Run [=implementation-defined=] malware scans and safe browsing checks.
If these checks fail, [=/reject=] |result| with an
"{{AbortError}}" {{DOMException}} and abort.
1. If |entry| is a [=file entry=]:
1. If |destination_entry| is not in the Origin Private File System:
1. If |destinationEntry| is not in the Origin Private File System:
1. Run [=implementation-defined=] malware scans and safe browsing checks.
If these checks fail, [=/reject=] |result| with an
"{{AbortError}}" {{DOMException}} and abort.

1. Attempt to move |entry| to |destination_entry| in the underlying file system.
1. Attempt to move |entry| to |destinationEntry| in the underlying file system.
1. If the underlying move operation throws an exception, [=/reject=]
|result| with that exception and abort.

Issue(68): Better specify what possible exceptions this could throw.

1. Set |entry|'s [=entry/name=] to |new_name|.
1. Set |entry|'s [=entry/name=] to |newName|.

1. [=/Resolve=] |result| with `undefined`.

Expand Down

0 comments on commit 5909c98

Please sign in to comment.