Fixes for review
This commit is contained in:
@@ -25,8 +25,7 @@ const ModulePromise = initModule();
|
||||
export function rethrowIfCritical(err) {
|
||||
// If it's precisely Error, it's a custom error; anything else - SyntaxError,
|
||||
// WebAssembly.RuntimeError, TypeError, etc. - is treated as critical here.
|
||||
if (err.constructor !== Error)
|
||||
{
|
||||
if (err.constructor !== Error) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
@@ -45,8 +44,7 @@ export async function connect() {
|
||||
* @param {(ctx: Context) => Promise<T>} op
|
||||
* @returns {Promise<T>}
|
||||
*/
|
||||
function schedule(op)
|
||||
{
|
||||
function schedule(op) {
|
||||
let res = queue.then(() => op(context));
|
||||
queue = res.catch(rethrowIfCritical);
|
||||
return res;
|
||||
|
||||
@@ -23,8 +23,8 @@ export const isDebug = new URLSearchParams(location.search).has('debug');
|
||||
|
||||
const Stats = isDebug
|
||||
? await import('stats.js').then(
|
||||
res => /** @type {typeof import('stats.js')} */ (res['default'])
|
||||
)
|
||||
res => /** @type {typeof import('stats.js')} */(res['default'])
|
||||
)
|
||||
: null;
|
||||
|
||||
/** @extends Component<{ getPreview?: () => Promise<Blob> }, { error?: string }> */
|
||||
@@ -96,9 +96,9 @@ export class Preview extends Component {
|
||||
blob,
|
||||
ratio
|
||||
? {
|
||||
resizeWidth: canvas.width,
|
||||
resizeHeight: canvas.height
|
||||
}
|
||||
resizeWidth: canvas.width,
|
||||
resizeHeight: canvas.height
|
||||
}
|
||||
: {}
|
||||
);
|
||||
if (!ratio) {
|
||||
|
||||
Reference in New Issue
Block a user