diff --git a/index.bs b/index.bs index 83d1f08..d7600a8 100644 --- a/index.bs +++ b/index.bs @@ -212,7 +212,7 @@ Their [=deserialization steps=], given |serialized| and |value| are: 1. If |serialized|.\[[Origin]] is not [=same origin=] with |value|'s [=relevant settings object=]'s [=environment settings object/origin=], - then throw a {{DataCloneError}}. + then throw a "{{DataCloneError}}" {{DOMException}}. 1. Set |value|'s [=FileSystemHandle/entry=] to |serialized|.\[[Entry]] @@ -462,7 +462,7 @@ and its async iterator |iterator| are: [=file system entry/query access=] given "`read`". 1. If |access| is not "{{PermissionState/granted}}", - throw a {{NotAllowedError}}. + throw a "{{NotAllowedError}}" {{DOMException}}. 1. Set |iterator|'s past results to an empty [=/set=]. @@ -674,7 +674,7 @@ The removeEntry(|name|, |options|) @@ -1073,7 +1073,8 @@ Issue(35): Specify how Access Handles should react when reading from a file that
The read(|buffer|, {{FileSystemReadWriteOptions}}: |options|) method steps are: -1. If [=this=].[=[[state]]=] is "`closed`", throw an {{InvalidStateError}}. +1. If [=this=].[=[[state]]=] is "`closed`", throw an "{{InvalidStateError}}" + {{DOMException}}. 1. Let |bufferSize| be |buffer|'s [=byte length=]. 1. Let |fileContents| be [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s [=file entry/binary data=]. 1. Let |fileSize| be |fileContents|'s [=byte sequence/length=]. @@ -1114,7 +1115,8 @@ The read(|buffer|, {{FileSystemReadWr
The write(|buffer|, {{FileSystemReadWriteOptions}}: |options|) method steps are: -1. If [=this=].[=[[state]]=] is "`closed`", throw an {{InvalidStateError}}. +1. If [=this=].[=[[state]]=] is "`closed`", throw an "{{InvalidStateError}}" + {{DOMException}}. 1. Let |writePosition| be |options|["{{FileSystemReadWriteOptions/at}}"] if |options|["{{FileSystemReadWriteOptions/at}}"] [=map/exists=]; otherwise [=this=]'s [=FileSystemSyncAccessHandle/file position cursor=]. @@ -1137,7 +1139,8 @@ The write(|buffer|, {{FileSystemReadW 1. Set |tail| to a [=byte sequence=] containing the last |oldSize| − (|writePosition| + |bufferSize|) bytes of |fileContents|. 1. Let |newSize| be |head|'s [=byte sequence/length=] + |bufferSize| + |tail|'s [=byte sequence/length=]. -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 [=file entry/binary data=] to the concatenation of |head|, the contents of |buffer| and |tail|. Note: The mechanism used to access buffer's contents is left purposely vague. @@ -1151,7 +1154,7 @@ The write(|buffer|, {{FileSystemReadW 1. Let |bytesWritten| be the number of bytes that were written from |buffer|. 1. Set [=this=]'s [=FileSystemSyncAccessHandle/file position cursor=] to |writePosition| + |bytesWritten|. 1. Return |bytesWritten|. - 1. Otherwise throw an {{InvalidStateError}}. + 1. Otherwise throw an "{{InvalidStateError}}" {{DOMException}}. 1. Set [=this=]'s [=FileSystemSyncAccessHandle/file position cursor=] to |writePosition| + |bufferSize|. 1. Return |bufferSize|. @@ -1169,23 +1172,24 @@ The 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