mirror of
https://github.com/google/blockly.git
synced 2026-03-07 05:40:12 +01:00
fix(generators): Changes to exports and access controls for TypeScript compatibility (#7295)
* fix(generators): Add missing declarations for Order enums
* chore(generators): Remove spurious whitespace
* fix(generators): Make provideFunction_ etc. public
Remove the protected declaration on provideFunction_ and
FUNCTION_NAME_PLACEHOLDER_ so they can be used from generator
functions written in TypeScript.
Not strictly part of #7283, but closely related and required to
fixing the related issue google/blockly-samples#1785.
* chore(generators): format
(cherry picked from commit d503fbb409)
This commit is contained in:
committed by
Eric Blackmon
parent
20423346b8
commit
bd84ffaecd
@@ -49,7 +49,7 @@ export class CodeGenerator {
|
||||
* legitimately appear in a function definition (or comment), and it must
|
||||
* not confuse the regular expression parser.
|
||||
*/
|
||||
protected FUNCTION_NAME_PLACEHOLDER_ = '{leCUI8hutHZI4480Dc}';
|
||||
FUNCTION_NAME_PLACEHOLDER_ = '{leCUI8hutHZI4480Dc}';
|
||||
FUNCTION_NAME_PLACEHOLDER_REGEXP_: RegExp;
|
||||
|
||||
/**
|
||||
@@ -471,10 +471,7 @@ export class CodeGenerator {
|
||||
* @returns The actual name of the new function. This may differ from
|
||||
* desiredName if the former has already been taken by the user.
|
||||
*/
|
||||
protected provideFunction_(
|
||||
desiredName: string,
|
||||
code: string[] | string
|
||||
): string {
|
||||
provideFunction_(desiredName: string, code: string[] | string): string {
|
||||
if (!this.definitions_[desiredName]) {
|
||||
const functionName = this.nameDB_!.getDistinctName(
|
||||
desiredName,
|
||||
|
||||
Reference in New Issue
Block a user