🐛 Add support for TypedArrays in IPC.
Fixes https://github.com/electron/electron/issues/2104.
This commit is contained in:
parent
99ec841a8e
commit
c717cd9192
3 changed files with 29 additions and 2 deletions
16
lib/common/api/is-typed-array.js
Normal file
16
lib/common/api/is-typed-array.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
'use strict'
|
||||
|
||||
module.exports = function isTypedArray(val) {
|
||||
return (
|
||||
val &&
|
||||
(val instanceof Int8Array
|
||||
|| val instanceof Int16Array
|
||||
|| val instanceof Int32Array
|
||||
|| val instanceof Uint8Array
|
||||
|| val instanceof Uint8ClampedArray
|
||||
|| val instanceof Uint16Array
|
||||
|| val instanceof Uint32Array
|
||||
|| val instanceof Float32Array
|
||||
|| val instanceof Float64Array)
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue