Freeze Template Objects in __makeTemplateObject#51806
Closed
DanielRosenwasser wants to merge 2 commits intomainfrom
Closed
Freeze Template Objects in __makeTemplateObject#51806DanielRosenwasser wants to merge 2 commits intomainfrom
__makeTemplateObject#51806DanielRosenwasser wants to merge 2 commits intomainfrom
Conversation
The closer to the spec, the better for reliability. 14. Perform ! DefinePropertyOrThrow(template, "raw", PropertyDescriptor { [[Value]]: rawObj, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }). |
Member
Author
|
We just no longer support ES5 as an output target starting with TS6. |
This file contains hidden or 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
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.
This PR has our
__makeTemplateObjecthelper freeze the arrays passed into it. This is more correct according to the ECMAScript spec for our downlevel support in ES5 for tagged template strings, as template objects (a.k.aTemplateStringsArrays) are supposed to be deeply frozen.While we're here, maybe I should also make the
rawproperty non-enumerable. I don't know if configurability/writability matters if we're just freezing the object after anyway.Fixes #51789.