-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Hermes] Handle unicode characters in 'show source'
Summary: The unconventional encoding used in the string table requires that input unicode source has to be reencoded before being added to the table. ASCII source can be used unmodified. Copy `appendUnicodeToStorage` over from the JSLexer to allow for reencoding the source during HBC generation. @already-on-github Test Plan: add a test Reviewers: tmikov, #hermes-buddies, #hermes Reviewed By: tmikov Subscribers: #hermes Differential Revision: https://phabricator.intern.facebook.com/D46324771 Tasks: T151863959 Tags: hermes
- Loading branch information
Showing
4 changed files
with
106 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// RUN: %hermes -O %s | %FileCheck --match-full-lines %s | ||
// RUN: %hermes -lazy %s | %FileCheck --match-full-lines %s | ||
// UNSUPPORTED: serializer | ||
|
||
var x = function 𞸆() { 'show source'; } | ||
print(x.toString()); | ||
// CHECK: function 𞸆() { 'show source'; } |