GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add support for extended Unicode escape sequences in strings and templates by DanielRosenwasser · Pull Request #2169 · microsoft/TypeScript

Conversation

@DanielRosenwasser

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) commented Feb 27, 2015

Copy link
Copy Markdown
Member

Fixes #2047.

ES6 extended escapes take the form of \u{XXXXX...} where XXXXX... is any number of hex digits. It is a syntax error if the value of these digits is greater than 0x10FFFF. When interpreting the value of such a code point, it must be interpreted as two individual UTF16 codepoints through a well-defined encoding scheme.

Notable changes are:

  • We support extended ES6 escape sequences as is.
  • We support downlevel emit for ES6 escape sequences, using \uXXXX escapes for any non-ASCII characters in the original string.
  • Template strings always use \uXXXX escapes for any non-ASCII characters.

Things we still don't support:

  • Escapes in regular expressions.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Daniel Rosenwasser (DanielRosenwasser) added 10 commits February 25, 2015 14:01
@DanielRosenwasser
Added tests for escapes in strings, regexes, and templates.
f16e875
@DanielRosenwasser
Simplified scanHexDigits by just wrapping the intended functionality …
ee71954
…in separate functions.
@DanielRosenwasser
Merge branch 'master' into withANameLikeUnicodeYoudThinkThereWouldntB…
1e602de
…eSoManyWaysToDoIt
@DanielRosenwasser
Added tests and updated baselines.
6ad1780
@DanielRosenwasser
Added scanning support for extended escapes.
bbf9579
@DanielRosenwasser
Emit non-ASCII characters with unicode escape sequences.
a81bf8c
@DanielRosenwasser
Made unicode escapes use uppercase hex codes.
9d89668
...because caps lock is cruise control for cool.
@DanielRosenwasser
Emit all strings with extended escapes using the same scheme as templ…
4657c2d
…ates.
@DanielRosenwasser
Only add an extended Unicode escape when it is entirely valid.
cad8f6b
@DanielRosenwasser
Merge branch 'master' into withANameLikeUnicodeYoudThinkThereWouldntB…
3c34478
…eSoManyWaysToDoIt

Conflicts:
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
@msftclas Microsoft Contribution License Agreements (msftclas) added the cla-not-required label Feb 27, 2015
@DanielRosenwasser
Removed unused variable.
5437b3d
CyrusNajmabadi
CyrusNajmabadi reviewed Feb 28, 2015
View reviewed changes
Comment thread src/compiler/diagnosticInformationMap.generated.ts Outdated

@CyrusNajmabadi Cyrus Najmabadi (CyrusNajmabadi) Feb 28, 2015

Copy link
Copy Markdown
Contributor

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.

'Unterminated unicode escape'

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Daniel Rosenwasser (DanielRosenwasser) added 5 commits February 27, 2015 18:13
@DanielRosenwasser
Addressed some CR feedback.
b1837c8
@DanielRosenwasser
Fixed error message.
6be13a9
@DanielRosenwasser
Harden against trees without parent pointers for emitting literals; f…
5ec68eb
…ix lookahead in text for numeric literal indicators.
@DanielRosenwasser
Addressed CR feedback, also properly accounted for template literals.
f9cc013
@DanielRosenwasser
Words.
5c5a489
Daniel Rosenwasser (DanielRosenwasser) added a commit that referenced this pull request Mar 3, 2015
@DanielRosenwasser
Merge pull request #2169 from Microsoft/withANameLikeUnicodeYoudThink…
7212912
…ThereWouldntBeSoManyWaysToDoIt

Add support for extended Unicode escape sequences in strings and templates
@DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) merged commit 7212912 into master Mar 3, 2015
@DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) deleted the withANameLikeUnicodeYoudThinkThereWouldntBeSoManyWaysToDoIt branch March 3, 2015 20:16
@microsoft Microsoft (microsoft) locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

ES6 extended Unicode syntax for strings and template strings

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@DanielRosenwasser @yuit @CyrusNajmabadi @msftclas
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.