Trimmed leading and trailing spaces when reading string literals after "[" and added a test case.#62144
Trimmed leading and trailing spaces when reading string literals after "[" and added a test case.#62144falshami2002 wants to merge 2 commits intomicrosoft:mainfrom
Conversation
…auses an incorrect hover display microsoft#62101
…d ES6 test cases. Passing all test cases now.
|
@microsoft-github-policy-service agree |
|
It looks like one check failed, but the logs indicate "429 (Too many requests)". This is my first contribution, so let me know if anything is needed on my end, or if there was anything I could do better. Thank you for your time. |
|
I'm not sure how the name includes spaces to begin with. Does this do "the right thing" if there is a comment on either side of the string? |
|
@DanielRosenwasser I double checked with test cases of [ "x" ] and [ /--comment1--/ "x" /--comment2--/]. Everything appears to work correctly. It looks like symbolName begins as: ["x" ]. After going through the if statement in line 8860, we end up with substring(1, len - 1) which ends up being "x"/space/. When we trim before passing into stripQuotes in the if block starting at line 8865, it allows stripQuotes to function correctly. stripQuotes checks for name.charCodeAt(0) === name.charCodeAt(length - 1), so if we don't strip, we are comparing " to /space/ and it just returns the original string, without stripping. createStringLiteral then adds it's own quotes on top of that and escapes the existing ones, giving us the output in the issue. |
|
🤖 AI Assistant: Task completed: PR #62144: Trimmed leading and trailing spaces when reading string literals after "[" and added a te... |
1 similar comment
|
🤖 AI Assistant: Task completed: PR #62144: Trimmed leading and trailing spaces when reading string literals after "[" and added a te... |
|
With 6.0 out as the final release vehicle for this codebase, we're closing all PRs that don't fit the merge criteria for post-6.0 patches. If you think this was a mistake and this PR fits the post-6.0 patch criteria, please post to the 6.0 iteration issue with details (specifically, which PR and which patch criteria it satisfies). Next steps for PRs:
|
Fixes #62101