Uh oh!
There was an error while loading. Please reload this page.
Non-ASCII character support - #45736
Conversation
test constisLiteralSymbol=(char)=>{constcode=char.charCodeAt(0);if(code>127){returntrue;}if(char>='0'&&char<=9){returnfalse;}if(code===35){returnfalse;}returntrue;}output isLiteralSymbol('أهلا')true |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
mertcanaltin
commented
Dec 4, 2022
@anonrig I applied the changes, thank you very much for the review 🚀 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
anonrig
commented
Dec 4, 2022
@manekinekko Can you review this? |
MoLow
left a comment
There was a problem hiding this comment.
the change LGTM, but this seems to break quite a few tests
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Could you:
- group these into 2 groups: literals (
true) and non-literals (false)? - add more samples of non-Latin characters? you can cherry-pick from this list here.
There was a problem hiding this comment.
@manekinekko thank you so much i will fly here 🚀
There was a problem hiding this comment.
@manekinekko would that be healthy
{constliterals=['A','a','-','+','أ','ت','ث','讲','演','講'];constnonLiterals=['0','#','\\','+','-'];literals.forEach((literal)=>{assert.strictEqual(isLiteralSymbol(literal),true);});nonLiterals.forEach((nonLiteral)=>{assert.strictEqual(isLiteralSymbol(nonLiteral),false);});}mertcanaltin
commented
Dec 5, 2022
I'm so sorry I triggered you all to review, sorry for the extra notifications :/ |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
mertcanaltin
commented
Dec 5, 2022
@manekinekko I sent the edits thank you very much |
There was a problem hiding this comment.
Should we really accept zero width characters as acceptable input? I would skip all of them. We also already have a function to check for these:
node/lib/internal/util/inspect.js
Lines 2388 to 2398 in ab064d1
I didn't accept zero-width characters @BridgeAR i will update the code like this if(typeofchar!=='string'||util.inspect.isZeroWidthCodePoint(char)){returnfalse;}can I do it like this? |
cjihrig
commented
Dec 12, 2022
@mertcanaltin I think that would be ok. |
MoLow
commented
Feb 8, 2023
CC @nodejs/test_runner @manekinekko additional reviews will be appreciated |
MoLow
commented
Feb 8, 2023
@anonrig can you please dismiss your review/approve? |
nodejs-github-bot
commented
Feb 18, 2023
nodejs-github-bot
commented
Feb 18, 2023
Landed in 3c6547f |
mertcanaltin
commented
Feb 18, 2023
🎉 |
PR-URL: #45736 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: #45736 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: nodejs#45736 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Fixes#45706
Fixes#46508