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
* Properly prohibit SharedArrayBuffers by default
* Introduce the allowShared option to allow them
* Throw on detached ArrayBuffers
Note that the tests for detached ArrayBuffers are not run in Node v10, since there the worker_threads module is experimental and there is no way to create a detached ArrayBuffer.
Copy file name to clipboardExpand all lines: README.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,11 +56,11 @@ Conversions for all of the basic types from the Web IDL specification are implem
56
56
-[`DOMString`](https://heycam.github.io/webidl/#es-DOMString), which can additionally be provided the boolean option `{ treatNullAsEmptyString }` as a second parameter
-[Buffer source types](https://heycam.github.io/webidl/#es-buffer-source-types), which can additionally be provided with the boolean option `{ allowShared }` as a second parameter
60
60
61
61
Additionally, for convenience, the following derived type definitions are implemented:
-[`ArrayBufferView`](https://heycam.github.io/webidl/#ArrayBufferView), which can additionally be provided with the boolean option `{ allowShared }` as a second parameter
@@ -76,6 +76,10 @@ To mitigate this, we could return the raw BigInt value from the conversion funct
76
76
77
77
On the other hand, `long long` conversion is always accurate, since the input value can never be more precise than the output value.
78
78
79
+
### A note on `BufferSource` types
80
+
81
+
All of the `BufferSource` types will throw when the relevant `ArrayBuffer` has been detached. This technically is not part of the [specified conversion algorithm](https://heycam.github.io/webidl/#es-buffer-source-types), but instead part of the [getting a reference/getting a copy](https://heycam.github.io/webidl/#ref-for-dfn-get-buffer-source-reference%E2%91%A0) algorithms. We've consolidated them here for convenience and ease of implementation, but if there is a need to separate them in the future, please open an issue so we can investigate.
82
+
79
83
## Background
80
84
81
85
What's actually going on here, conceptually, is pretty weird. Let's try to explain.
0 commit comments