Skip to content

Commit

Permalink
changed expression id generation
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Deubler <[email protected]>
  • Loading branch information
TerminalTim committed Jul 24, 2024
1 parent b1cc228 commit bec1365
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/common/src/Expressions/Expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ let expId = 0;

export abstract class Expression implements IExpression {
static operator: string;
protected id?: string | number;
protected _id?: string | number;

static isExpression(exp) {
return exp instanceof Expression;
Expand Down Expand Up @@ -109,7 +109,7 @@ export abstract class Expression implements IExpression {
return env.evaluate(this, context, mode, cache);
}

private getId() {
return this.id ||= ++expId;
id() {
return this._id ||= ++expId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ export class FeatureFactory {
if (!strokeWidth) continue;

if (isDynamicProperty(strokeWidth)) {
widthId = strokeWidth.getId();
widthId = (strokeWidth as Expression).id();
} else {
[strokeWidth, sizeUnit] = parseSizeValue(strokeWidth);
widthId = strokeWidth;
Expand Down

0 comments on commit bec1365

Please sign in to comment.