js-on-sx: decodeURI/decodeURIComponent + harness decimalToHexString
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 45s

This commit is contained in:
2026-05-08 19:02:44 +00:00
parent 0d99b5dfe8
commit 5b501f7937
3 changed files with 160 additions and 2 deletions

View File

@@ -146,6 +146,16 @@ var isConstructor = function (f) {
// Best-effort: built-in functions and arrows aren't; declared `function` decls are.
return false;
};
// decimalToHexString.js include — used by URI/escape tests.
var decimalToHexString = function (n) {
var hex = "0123456789ABCDEF";
if (n < 0) { n = n + 65536; }
return hex[(n >> 12) & 15] + hex[(n >> 8) & 15] + hex[(n >> 4) & 15] + hex[n & 15];
};
var decimalToPercentHexString = function (n) {
var hex = "0123456789ABCDEF";
return "%" + hex[(n >> 4) & 15] + hex[n & 15];
};
// Trivial helper for tests that use Array.isArray-like functionality
// (many tests reach for it via compareArray)
"""