-
Notifications
You must be signed in to change notification settings - Fork 2k
lexer: fix expression to decode surrogate pairs #3278
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
Conversation
3bf6197
to
b1d1338
Compare
@Cito Sorry for the long review time. |
Hi @IvanGoncharov - have a look at the C function It doesn't matter whether you use '|' or '+' to combine the trailing and shifted leading values, because their bit patterns do not overlap. But you can't use '|' to add the |
544591d
to
b1d1338
Compare
@Cito Thanks for the PR and explanation. |
* Export OperationTypeNode as value (graphql#3316) * Convert const "enum-like" maps to TS enums (graphql#3317) * Deprecate 'ASTKindToNode' (graphql#3318) * Add message that we only support TS >= 4.1.0 (graphql#3319) * Update deps (graphql#3320) * 16.0.0-rc.5 * jsutils: add test for Path functions (graphql#2478) Co-authored-by: Ivan Goncharov <[email protected]> * lexer: fix expression to decode surrogate pairs (graphql#3278) * Lexer: use standard JS functions to handle Unicode (graphql#3322) * GraphQLError-test: merge check of source with rest of the properties (graphql#3324) * GraphQLError: fix empty `locations` if error got nodes without locations (graphql#3325) * GraphQLError: enumerate only spec prescribed properties (graphql#3326) * GraphQLField: relax default value of TArgs to `any` (graphql#3328) * 16.0.0-rc.6 * Fix release instructions (graphql#3329) * use GITHUB_TOKEN (graphql#3330) * GraphQLError: Add test to check order of fields in JSON.stringify (graphql#3336) * Fix TS error caused by importing internal files directly (graphql#3339) * Use default GITHUB_ACTOR if unset (graphql#3331) Co-authored-by: Ivan Goncharov <[email protected]> * 16.0.0-rc.7 * version: force proper typing on version literals Types should be generic and stay the same across different versions E.g. `preReleaseTag` should be typed `string | null` even if it's a `null` literal for this particular release * build-npm: fix type inference during TS declarations build * version-test: fix validation of `versionInfo.preReleaseTag` (graphql#3345) * 16.0.0 * checkgit.sh: Added a check for local modifications (graphql#3347) * GraphQLError-test: text how extensions is inherited from originalError (graphql#3348) * fix lockfile * update graphql version * Remove unused upstream file * Upgrade deps * add changeset Co-authored-by: Ivan Goncharov <[email protected]> Co-authored-by: Christoph Zwerschke <[email protected]>
When calculating the code point for a surrogate pair, the base code point of 0x10000 must be added, not bitwise ORed. Added some tests for catching this problem.