Skip to content

refactor: use JS this instead of passing the element via $0 in Element.executeJs#24601

Open
Artur- wants to merge 1 commit into
mainfrom
element-execjs-this
Open

refactor: use JS this instead of passing the element via $0 in Element.executeJs#24601
Artur- wants to merge 1 commit into
mainfrom
element-execjs-this

Conversation

@Artur-

@Artur- Artur- commented Jun 12, 2026

Copy link
Copy Markdown
Member

Element.executeJs() automatically binds this to the receiving element's DOM node, so passing the same element as an extra parameter just to reference it as $0 is redundant. Replaced these self-references with this in scrollIntoView, focus/blur, drag-source/drop-target activation, and setDragImage. setTimeout callbacks were switched to arrow functions so this survives the deferred invocation.

…ent.executeJs

Element.executeJs() automatically binds `this` to the receiving element's
DOM node, so passing the same element as an extra parameter just to
reference it as $0 is redundant. Replaced these self-references with
`this` in scrollIntoView, focus/blur, drag-source/drop-target activation,
and setDragImage. setTimeout callbacks were switched to arrow functions
so `this` survives the deferred invocation.
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Test Results

 1 447 files  ±0   1 447 suites  ±0   1h 21m 20s ⏱️ - 3m 45s
10 220 tests ±0  10 152 ✅ ±0  68 💤 ±0  0 ❌ ±0 
10 692 runs  ±0  10 623 ✅ ±0  69 💤 ±0  0 ❌ ±0 

Results for commit 105bdfb. ± Comparison against base commit 6d800e0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant