-
Notifications
You must be signed in to change notification settings - Fork 228
fix: resolve 4 bugs in termui #3622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -138,3 +138,5 @@ export class Form extends Widget { | |
| } | ||
| } | ||
| } | ||
|
|
||
| .catch(err => console.error("Promise.all failed:", err)); | ||
|
Comment on lines
+141
to
+142
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win Attach the rejection handler to the Promise expression. Line 142 is a standalone try {
const results = await Promise.all(existingPromises);
// Existing result handling.
} catch (err) {
console.error("Promise.all failed:", err);
throw err;
}🧰 Tools🪛 Biome (2.5.6)[error] 142-142: Expected a statement but instead found '.catch(err => console.error("Promise.all failed:", err))'. (parse) 🪛 GitHub Actions: CI / 0_build-and-test.txt[error] 142-142: 🪛 GitHub Actions: CI / build-and-test[error] 142-142: The 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🌐 Web query:
Does JavaScript String.fromCodePoint throw RangeError for values greater than 0x10FFFF?💡 Result:
Yes, the JavaScript String.fromCodePoint method throws a RangeError if any of the provided arguments are greater than 0x10FFFF [1][2]. According to the ECMAScript specification, String.fromCodePoint iterates through its arguments and performs a check to ensure each is a valid Unicode code point [3][4]. A value is considered invalid if it is not an integral number, is less than 0, or is greater than 0x10FFFF [3][4]. If any of these conditions are met, the method throws a RangeError exception [1][3]. This behavior is consistent across all modern JavaScript environments as defined by the ECMAScript standard [3][5][6][4].
Citations:
🏁 Script executed:
Repository: Karanjot786/TermUI
Length of output: 5558
Reject overlong and invalid hexadecimal entities.
entity.slice(2, 10)can turn longer malformed entities into valid values or pass values above0x10fffftoString.fromCodePoint, which throwsRangeErrorand stops RSS parsing. Skip entities with more than eight hexadecimal digits before parsing, validatecodePoint <= 0x10ffffbefore conversion, and apply the same range check to decimal numeric entities.Proposed fix
if (entity.startsWith('`#x`')) { - const codePoint = Number.parseInt(entity.slice(2, 10), 16); - return Number.isFinite(codePoint) ? String.fromCodePoint(codePoint) : match; + const digits = entity.slice(2); + if (digits.length > 8) return match; + const codePoint = Number.parseInt(digits, 16); + return codePoint <= 0x10ffff ? String.fromCodePoint(codePoint) : match; }🤖 Prompt for AI Agents