@param {boolean=} noRunDep
(url, onload, onerror, noRunDep)
| 1793 | |
| 1794 | /** @param {boolean=} noRunDep */ |
| 1795 | function asyncLoad(url, onload, onerror, noRunDep) { |
| 1796 | var dep = !noRunDep ? getUniqueRunDependency('al ' + url) : ''; |
| 1797 | readAsync(url, (arrayBuffer) => { |
| 1798 | assert(arrayBuffer, 'Loading data file "' + url + '" failed (no arrayBuffer).'); |
| 1799 | onload(new Uint8Array(arrayBuffer)); |
| 1800 | if (dep) removeRunDependency(dep); |
| 1801 | }, (event) => { |
| 1802 | if (onerror) { |
| 1803 | onerror(); |
| 1804 | } else { |
| 1805 | throw 'Loading data file "' + url + '" failed.'; |
| 1806 | } |
| 1807 | }); |
| 1808 | if (dep) addRunDependency(dep); |
| 1809 | } |
| 1810 | |
| 1811 | |
| 1812 |
no test coverage detected