Skip to content

Commit 0176b29

Browse files
Abhishek Bindraclaude
andcommitted
refactor(fingerprint): simplify htmlHash computation in DqElement
computeFingerprintHash handles null input internally, so the ternary and try/catch wrapper are unnecessary. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d59ad28 commit 0176b29

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

lib/core/utils/dq-element.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,7 @@ const DqElement = memoize(function DqElement(elm, options, spec) {
343343
}
344344

345345
// [a11y-core]: compute htmlHash before truncation
346-
try {
347-
this._htmlHash = this._element
348-
? computeFingerprintHash(this._element.outerHTML)
349-
: computeFingerprintHash(null);
350-
} catch {
351-
this._htmlHash = computeFingerprintHash(null);
352-
}
346+
this._htmlHash = computeFingerprintHash(this._element?.outerHTML);
353347

354348
/**
355349
* The generated HTML source code of the element

0 commit comments

Comments
 (0)