Skip to content

Commit

Permalink
Catch dynamic load fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Irrelon committed Mar 20, 2024
1 parent 0c5bdeb commit 7138558
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/engine/core/IgePoint3d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ let IgeTweenModule: typeof IgeTween;

import("./IgeTween.js").then((module) => {
IgeTweenModule = module.IgeTween;
}).catch(() => {
class IgeTweenFake {
constructor () {
throw new Error("Could not dynamically load IgeTween class!");
}
}

IgeTweenModule = IgeTweenFake as unknown as typeof IgeTween;
});

/**
Expand Down Expand Up @@ -45,8 +53,8 @@ export class IgePoint3d {
* @param {boolean=} val True or false.
* @return {*} Either `this` for chaining or current floor setting.
*/
floor(val: boolean): this;
floor(): boolean;
floor (val: boolean): this;
floor (): boolean;
floor (val?: boolean) {
if (val !== undefined) {
this._floor = val;
Expand Down

0 comments on commit 7138558

Please sign in to comment.