From a6208d78b760959535fc5874c637878067f4919b Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Fri, 15 Mar 2024 23:01:46 +0100 Subject: [PATCH] fix(generators): Make `scrub_` `public` (#7940) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #2156. In PRs #7602, #7616, #7646, #7647 and #7654 the @protected access modifier on scrub_ on the CodeGenerator subclasses was not transcribed to the new typescript signature. I was going to re-add it, but this breaks some of the procedure block generator functions which rely on it, and then @BeksOmega pointed out that this might be one of the CodeGenerator API functions which we had already decided should be public—and lo and behold I found #2156. Per discussion amongst team, I am not renaming it to scrub at this time. --- core/generator.ts | 6 +----- generators/javascript/javascript_generator.ts | 1 - generators/python/python_generator.ts | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/core/generator.ts b/core/generator.ts index d94597fc127..c7c26f15f40 100644 --- a/core/generator.ts +++ b/core/generator.ts @@ -578,11 +578,7 @@ export class CodeGenerator { * @param _opt_thisOnly True to generate code for only this statement. * @returns Code with comments and subsequent blocks added. */ - protected scrub_( - _block: Block, - code: string, - _opt_thisOnly?: boolean, - ): string { + scrub_(_block: Block, code: string, _opt_thisOnly?: boolean): string { // Optionally override return code; } diff --git a/generators/javascript/javascript_generator.ts b/generators/javascript/javascript_generator.ts index 02602e71fa4..592563f919d 100644 --- a/generators/javascript/javascript_generator.ts +++ b/generators/javascript/javascript_generator.ts @@ -251,7 +251,6 @@ export class JavascriptGenerator extends CodeGenerator { * @param code The JavaScript code created for this block. * @param thisOnly True to generate code for only this statement. * @returns JavaScript code with comments and subsequent blocks added. - * @protected */ scrub_(block: Block, code: string, thisOnly = false): string { let commentCode = ''; diff --git a/generators/python/python_generator.ts b/generators/python/python_generator.ts index 0700318c2d9..bf7b87496ee 100644 --- a/generators/python/python_generator.ts +++ b/generators/python/python_generator.ts @@ -276,7 +276,6 @@ export class PythonGenerator extends CodeGenerator { * @param code The Python code created for this block. * @param thisOnly True to generate code for only this statement. * @returns Python code with comments and subsequent blocks added. - */ scrub_(block: Block, code: string, thisOnly = false): string { let commentCode = '';