write(|buffer|, {{FileSystemReadW
The truncate(|newSize|) method steps are:
-1. If [=this=].[=[[state]]=] is "`closed`", throw an {{InvalidStateError}}.
+1. If [=this=].[=[[state]]=] is "`closed`", throw an "{{InvalidStateError}}"
+ {{DOMException}}.
1. Let |fileContents| be a copy of [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s [=file entry/binary data=].
1. 1. Let |oldSize| be the [=byte sequence/length=] of [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s [=file entry/binary data=].
1. If the underlying file system does not support setting a file's size to
|newSize|, throw a {{TypeError}}.
1. If |newSize| is larger than |oldSize|:
- 1. If |newSize| − |oldSize| exceeds the available [=storage quota=], throw a {{QuotaExceededError}}.
+ 1. If |newSize| − |oldSize| exceeds the available [=storage quota=], throw a "{{QuotaExceededError}}" {{DOMException}}.
1. Set [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s to a [=byte sequence=] formed by concatenating
|fileContents| with a [=byte sequence=]
containing |newSize| − |oldSize| 0x00 bytes.
1. If the operations modifying the [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s [=file entry/binary data=] in the previous steps
- failed, throw an {{InvalidStateError}}.
+ failed, throw an "{{InvalidStateError}}" {{DOMException}}.
1. Otherwise, if |newSize| is smaller than |oldSize|:
1. Set [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s to a [=byte sequence=] containing the first |newSize| bytes
in |fileContents|.
1. If the operations modifying the [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s [=file entry/binary data=] in the previous steps
- failed, throw an {{InvalidStateError}}.
+ failed, throw an "{{InvalidStateError}}" {{DOMException}}.
1. If [=this=]'s [=FileSystemSyncAccessHandle/file position cursor=] is greater than |newSize|, then set [=FileSystemSyncAccessHandle/file position cursor=] to |newSize|.
@@ -1200,7 +1204,8 @@ The truncate(|newSize|) method
The getSize() method steps are:
-1. If [=this=].[=[[state]]=] is "`closed`", throw an {{InvalidStateError}}.
+1. If [=this=].[=[[state]]=] is "`closed`", throw an "{{InvalidStateError}}"
+ {{DOMException}}.
1. Return [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s [=file entry/binary data=]'s [=byte sequence/length=].
@@ -1281,7 +1286,7 @@ The getDirectory() method steps are:
1. Let |map| be the result of running [=obtain a local storage bottle map=]
with |environment| and `"fileSystem"`. If this returns failure,
- return [=a promise rejected with=] a {{SecurityError}}.
+ return [=a promise rejected with=] a "{{SecurityError}}" {{DOMException}}.
1. If |map|["root"] does not [=map/exist=]:
1. Let |dir| be a new [=directory entry=] whose [=query access=] and [=request access=] algorithms