Skip to content

Commit 303d9d6

Browse files
authored
Merge pull request #329 from tomayac/patch-9
Fix code samples
2 parents dd4fc6e + 57ed2f8 commit 303d9d6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

AccessHandle.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,16 @@ API](https://docs.google.com/document/d/1cOdnvuNIWWyJHz1uu8K_9DEgntMtedxfCzShI7d
116116
// In all contexts
117117
// For details on the `mode` parameter see "Exposing AccessHandles on all
118118
// filesystems" below
119-
const handle = await file.createAccessHandle({ mode: 'in-place' });
119+
const handle = await file.createAccessHandle({ mode: "in-place" });
120120
await handle.writable.getWriter().write(buffer);
121-
const reader = handle.readable.getReader({mode: "byob"});
121+
const reader = handle.readable.getReader({ mode: "byob" });
122122
// Assumes seekable streams, and SharedArrayBuffer support are available
123-
await reader.read(buffer, {at: 1});
123+
await reader.read(buffer, { at: 1 });
124124

125125
// Only in a worker context
126126
const handle = await file.createSyncAccessHandle();
127-
var writtenBytes = handle.write(buffer);
128-
var readBytes = handle.read(buffer {at: 1});
127+
const writtenBytes = handle.write(buffer);
128+
const readBytes = handle.read(buffer, { at: 1 });
129129
```
130130

131131
As mentioned above, a new *createAccessHandle()* method would be added to
@@ -150,10 +150,10 @@ default reader and writer with a *seek()* method.
150150
### Locking semantics
151151

152152
```javascript
153-
const handle1 = await file.createAccessHandle({ mode: 'in-place' });
153+
const handle1 = await file.createAccessHandle({ mode: "in-place" });
154154
try {
155-
const handle2 = await file.createAccessHandle({ mode: 'in-place' });
156-
} catch(e) {
155+
const handle2 = await file.createAccessHandle({ mode: "in-place" });
156+
} catch (e) {
157157
// This catch will always be executed, since there is an open access handle
158158
}
159159
await handle1.close();

0 commit comments

Comments
 (0)