This is an automated email from the ASF dual-hosted git repository. thiagohp pushed a commit to branch feature/coffeescript-to-typescript in repository https://gitbox.apache.org/repos/asf/tapestry-5.git
The following commit(s) were added to refs/heads/feature/coffeescript-to-typescript by this push: new 588c6e0df TAP5-2804: fixing scanners initialization in dom.js 588c6e0df is described below commit 588c6e0dfc6363b5024f2b5d71b0fd912abf0c9d Author: Thiago H. de Paula Figueiredo <thi...@arsmachina.com.br> AuthorDate: Mon Jun 2 19:01:13 2025 -0300 TAP5-2804: fixing scanners initialization in dom.js --- tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-jquery.ts | 6 +++--- .../src/main/typescript/src/t5/core/t5-core-dom-prototype.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-jquery.ts b/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-jquery.ts index e730b8b1a..073a170fa 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-jquery.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-jquery.ts @@ -417,7 +417,7 @@ let ajaxRequest = function(url: string, options?: AjaxRequestOptions) { type Scanner = (element: ElementWrapper) => void; -let scanners: Scanner[] = []; +let scanners: Scanner[] | null = null; let scanner = function(selector: string, callback: (e: ElementWrapper) => void) { var scan; @@ -434,8 +434,8 @@ let scanner = function(selector: string, callback: (e: ElementWrapper) => void) scanners = []; body!.on(events.initializeComponents, null, function() { var f, j, len; - for (j = 0, len = scanners.length; j < len; j++) { - f = scanners[j]; + for (j = 0, len = scanners!.length; j < len; j++) { + f = scanners![j]; f(body!); } }); diff --git a/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-prototype.ts b/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-prototype.ts index ee4dd9ed3..9f70b31e9 100644 --- a/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-prototype.ts +++ b/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-prototype.ts @@ -517,7 +517,7 @@ const ajaxRequest = function(url: string, options: AjaxRequestOptions | undefine type Scanner = (element: ElementWrapper) => void; -let scanners: Scanner[] = []; +let scanners: Scanner[] | null = null; let scanner = function(selector: string, callback: (e: ElementWrapper) => void) { var scan; @@ -534,8 +534,8 @@ let scanner = function(selector: string, callback: (e: ElementWrapper) => void) scanners = []; body!.on(events.initializeComponents, null, function() { var f, j, len; - for (j = 0, len = scanners.length; j < len; j++) { - f = scanners[j]; + for (j = 0, len = scanners!.length; j < len; j++) { + f = scanners![j]; f(body!); } });