Tonejs / Tone.js

A Web Audio framework for making interactive music in the browser.
https://tonejs.github.io
MIT License
13.39k stars 976 forks source link

For some older Androids, try catch statements will have problems #1070

Closed liJie-wk closed 2 years ago

liJie-wk commented 2 years ago
  1. try{}catch{} , There is a compatibility issue.

  2. Change to try{}catch(e) {} and solve it

tambien commented 2 years ago

thanks for the suggestion, do you know if this sort of thing counts?

https://github.com/Tonejs/Tone.js/blob/f34a963f1ba7fa760603b1360237d7792e373406/Tone/core/context/ToneAudioBuffer.ts#L72

if not, then i think all of the try/catch blocks take the e parameter (just did a quick search on the codebase).

liJie-wk commented 2 years ago

I'm sorry, but I don't quite understand what you mean. Its error message goes like this. Snipaste_2022-04-29_11-58-57

I changed all the try catches to this and that's fine 微信图片_20220428194552

@tambien

tambien commented 2 years ago

It's not in the Tone.js codebase, so it might be within a Tone.js dependency like standardized-audio-context.

@chrisguttandin does this code look familiar to you?

chrisguttandin commented 2 years ago

Yes, this looks very familiar. I'm pretty sure it's coming from here: https://github.com/chrisguttandin/standardized-audio-context/blob/b1e93e093c57b247ce78c281854681de959b38a6/src/helpers/is-constructible.ts#L15.

Am I correct that standardized-audio-context gets bundled with Tone.js? I thought so, since the file shown in the screenshots above is named Tone.js. Maybe it's an option to transpile standardized-audio-context before it gets bundled.

I'm trying to publish standardized-audio-context in a recent version of the EcmaScript spec. Right now it's ES2019. My reasoning behind this was that transpiling down from ES2019 to -for example- ES2015 is always possible whereas the opposite is a challenge.

However I also want to change the way I publish packages once more to use the new exports property. But I'm not sure when I will have time to finally do that. Maybe this allows to publish different EcmaScript versions simultaneously.

liJie-wk commented 2 years ago

Older versions of android-system-webview aOlder versions of android-system-webview are not supported by some syntaxre not supported by some syntax