mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -05:00
Turns out ArrayBuffers are not views of themselves.
This commit is contained in:
parent
3a4f620318
commit
c4ad76eef1
1 changed files with 4 additions and 3 deletions
|
@ -182,9 +182,10 @@ class VirtualMachine extends EventEmitter {
|
||||||
* @return {!Promise} Promise that resolves after targets are installed.
|
* @return {!Promise} Promise that resolves after targets are installed.
|
||||||
*/
|
*/
|
||||||
loadProject (input) {
|
loadProject (input) {
|
||||||
if (typeof input === 'object' && !ArrayBuffer.isView(input)) {
|
if (typeof input === 'object' && !(input instanceof ArrayBuffer) &&
|
||||||
// If the input is an object and not any ArrayBuffer view
|
!ArrayBuffer.isView(input)) {
|
||||||
// (this includes all typed arrays and DataViews)
|
// If the input is an object and not any ArrayBuffer
|
||||||
|
// or an ArrayBuffer view (this includes all typed arrays and DataViews)
|
||||||
// turn the object into a JSON string, because we suspect
|
// turn the object into a JSON string, because we suspect
|
||||||
// this is a project.json as an object
|
// this is a project.json as an object
|
||||||
// validate expects a string or buffer as input
|
// validate expects a string or buffer as input
|
||||||
|
|
Loading…
Reference in a new issue