You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[=this=]'s [=FileSystemSyncAccessHandle/file position cursor=].
1123
1125
1. If the underlying file system does not support writing to a file offset of
1124
-
|writePosition|, throw a {{TypeError}}.
1126
+
|writePosition|, [=throw=] a {{TypeError}}.
1125
1127
1. Let |fileContents| be a copy of [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s [=file entry/binary data=].
1126
1128
1. Let |oldSize| be |fileContents|'s [=byte sequence/length=].
1127
1129
1. Let |bufferSize| be |buffer|'s [=byte length=].
@@ -1140,7 +1142,7 @@ The <dfn method for=FileSystemSyncAccessHandle>write(|buffer|, {{FileSystemReadW
1140
1142
|oldSize| − (|writePosition| + |bufferSize|) bytes of |fileContents|.
1141
1143
1. Let |newSize| be |head|'s [=byte sequence/length=] + |bufferSize| + |tail|'s [=byte sequence/length=].
1142
1144
1. If |newSize| − |oldSize| exceeds the available [=storage quota=],
1143
-
throw a "{{QuotaExceededError}}" {{DOMException}}.
1145
+
[=throw=] a "{{QuotaExceededError}}" {{DOMException}}.
1144
1146
1. Set [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s [=file entry/binary data=] to the concatenation of |head|, the contents of |buffer| and |tail|.
1145
1147
1146
1148
Note: The mechanism used to access buffer's contents is left purposely vague.
@@ -1154,7 +1156,7 @@ The <dfn method for=FileSystemSyncAccessHandle>write(|buffer|, {{FileSystemReadW
1154
1156
1. Let |bytesWritten| be the number of bytes that were written from |buffer|.
1155
1157
1. Set [=this=]'s [=FileSystemSyncAccessHandle/file position cursor=] to |writePosition| + |bytesWritten|.
1156
1158
1. Return |bytesWritten|.
1157
-
1. Otherwise throw an "{{InvalidStateError}}" {{DOMException}}.
1159
+
1. Otherwise [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
1158
1160
1. Set [=this=]'s [=FileSystemSyncAccessHandle/file position cursor=] to |writePosition| + |bufferSize|.
1159
1161
1. Return |bufferSize|.
1160
1162
@@ -1172,24 +1174,25 @@ The <dfn method for=FileSystemSyncAccessHandle>write(|buffer|, {{FileSystemReadW
1172
1174
<div algorithm>
1173
1175
The <dfn method for=FileSystemSyncAccessHandle>truncate(|newSize|)</dfn> method steps are:
1174
1176
1175
-
1. If [=this=].[=[[state]]=] is "`closed`", throw an "{{InvalidStateError}}"
1177
+
1. If [=this=].[=[[state]]=] is "`closed`", [=throw=] an "{{InvalidStateError}}"
1176
1178
{{DOMException}}.
1177
1179
1. Let |fileContents| be a copy of [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s [=file entry/binary data=].
1178
1180
1. 1. Let |oldSize| be the [=byte sequence/length=] of [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s [=file entry/binary data=].
1179
1181
1. If the underlying file system does not support setting a file's size to
1180
-
|newSize|, throw a {{TypeError}}.
1182
+
|newSize|, [=throw=] a {{TypeError}}.
1181
1183
1. If |newSize| is larger than |oldSize|:
1182
-
1. If |newSize| − |oldSize| exceeds the available [=storage quota=], throw a "{{QuotaExceededError}}" {{DOMException}}.
1184
+
1. If |newSize| − |oldSize| exceeds the available [=storage quota=],
1185
+
[=throw=] a "{{QuotaExceededError}}" {{DOMException}}.
1183
1186
1. Set [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s to a [=byte sequence=] formed by concatenating
1. If the operations modifying the [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s [=file entry/binary data=] in the previous steps
1187
-
failed, throw an "{{InvalidStateError}}" {{DOMException}}.
1190
+
failed, [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
1188
1191
1. Otherwise, if |newSize| is smaller than |oldSize|:
1189
1192
1. Set [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s to a [=byte sequence=] containing the first |newSize| bytes
1190
1193
in |fileContents|.
1191
1194
1. If the operations modifying the [=this=].[=FileSystemSyncAccessHandle/[[file]]=]'s [=file entry/binary data=] in the previous steps
1192
-
failed, throw an "{{InvalidStateError}}" {{DOMException}}.
1195
+
failed, [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
1193
1196
1. If [=this=]'s [=FileSystemSyncAccessHandle/file position cursor=] is greater than |newSize|, then set [=FileSystemSyncAccessHandle/file position cursor=] to |newSize|.
1194
1197
1195
1198
</div>
@@ -1204,7 +1207,7 @@ The <dfn method for=FileSystemSyncAccessHandle>truncate(|newSize|)</dfn> method
1204
1207
<div algorithm>
1205
1208
The <dfn method for=FileSystemSyncAccessHandle>getSize()</dfn> method steps are:
1206
1209
1207
-
1. If [=this=].[=[[state]]=] is "`closed`", throw an "{{InvalidStateError}}"
1210
+
1. If [=this=].[=[[state]]=] is "`closed`", [=throw=] an "{{InvalidStateError}}"
0 commit comments