-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Make E.String always ascii or utf-8, never utf-16 #15163
Draft
pfgithub
wants to merge
70
commits into
main
Choose a base branch
from
pfg/e-string-changes-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… to have a bug where a rope isn't handled when it should be
…rted, and update toNumber to support rope strings + add a test
… size from 56 -> 40
…es decodeWtf8Rune, removes CodepointIterator.needsUTF8Decoding)
…g because it no longer matters & rename 'asWtf8JSON' to 'asWtf8AssertNotRope'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
("0" + "1") == 0
was true"\x00" + "1"
to"\x001"
+"§"
toNaN
"æ" + "™"
to"æ™"
"\uD800" + "\uDF34"
to"𐌴"
.let abc\u0070 = 5
would define a variable called "p" rather than "abcp"`\8`
because numeric escapes are not allowed in untagged template literalsReworks E.String
Previously:
"a"[0]
and"a".charCodeAt(0)
depended on not having utf-8.string.data
directly.("0" + "1") == 0
gave the wrong answer)Now:
.e_string.data
is now.e_string._value_or_segment_value
)TODO:
benchmark is in path
~/Dev/Node/temp/generated/fdae05571e21265e7f76681435cbed48/tmp
performance:
itertation it doesn't have to be special anymore and we can go back to strings.isValidUTF8
code:
fn decodeEscapeSequences
correctness:
--todo
flag--todo
flagc3 c3
should nextCodepointSlice to[c3]
not [c3, c3]`)\32
syntax error but\324
ok)--todo
flag\u{{{d}}}
->\u{{{X}}}
strings.wtf8Sequence()
,strings.encodeWTF8RuneT()
,strings.unicode.encodeWtf8WithInvalid()
and deduplicateesbuild/default.test.ts
, specificallydefault/RequireShimSubstitutionBrowser
RequireShimSubstitutionBrowser
seems to be broken? In node 23, it outputs default and module.exports. But shouldn't it be converting the esm import() to require()?