Skip to main content

Home > blockly > Procedures > findLegalName

Procedures.findLegalName() function

Ensure two identically-named procedures don't exist. Take the proposed procedure name, and return a legal name i.e. one that is not empty and doesn't collide with other procedures.

Signature:

export declare function findLegalName(name: string, block: Block): string;

Parameters

ParameterTypeDescription
namestringProposed procedure name.
blockBlockBlock to disambiguate.

Returns:

string

Non-colliding name.