fix: have inputs construct connections (#7116)

* fix: have inputs construct connections

* chore: fix build hopefully

* fix: PR comments
This commit is contained in:
Beka Westberg
2023-05-24 13:50:06 -07:00
committed by GitHub
parent 42b8c6e3ab
commit 473a5ab7b1
6 changed files with 35 additions and 43 deletions

View File

@@ -1568,13 +1568,7 @@ export class Block implements IASTNodeLocation, IDeletable {
* @returns The input object created.
*/
appendValueInput(name: string): Input {
return this.appendInput(
new ValueInput(
name,
this,
this.makeConnection_(ConnectionType.INPUT_VALUE)
)
);
return this.appendInput(new ValueInput(name, this));
}
/**
@@ -1586,13 +1580,7 @@ export class Block implements IASTNodeLocation, IDeletable {
*/
appendStatementInput(name: string): Input {
this.statementInputCount++;
return this.appendInput(
new StatementInput(
name,
this,
this.makeConnection_(ConnectionType.NEXT_STATEMENT)
)
);
return this.appendInput(new StatementInput(name, this));
}
/**
@@ -1632,7 +1620,7 @@ export class Block implements IASTNodeLocation, IDeletable {
false
);
if (!inputConstructor) return null;
return this.appendInput(new inputConstructor(name, this, null));
return this.appendInput(new inputConstructor(name, this));
}
/**
@@ -2309,8 +2297,9 @@ export class Block implements IASTNodeLocation, IDeletable {
*
* @param type The type of the connection to create.
* @returns A new connection of the specified type.
* @internal
*/
protected makeConnection_(type: number): Connection {
makeConnection_(type: ConnectionType): Connection {
return new Connection(this, type);
}