Skip to content
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

Refuse or convert rawInput that cannot be held weakly (in DedentTemplateStringsArray) #86

Open
iamstolis opened this issue Jul 8, 2024 · 2 comments

Comments

@iamstolis
Copy link

[[Raw]] of an entry of [[DedentMap]] is supposed to be Object (that's held weakly). Unfortunately DedentTemplateStringsArray() operation can create an entry where [[Raw]] is set to an arbitrary ECMAScript value because this operation does not perform any conversion/santity check on rawInput.

@jridgewell
Copy link
Member

Step 1 of String.dedent() is to ensure that templateOrFn is an object, which means that it could be held weakly. There's no way to verify whether the object itself is strongly held.

Note, too, that the CanBeHeldWeakly AO (used by WeakMaps) just checks If v is an Object, return true..

@iamstolis
Copy link
Author

Please, read my report again. It is not about templateOrFn not being an object but about rawInput (i.e. value of raw property of templateOrFn) not being an object.

@jridgewell jridgewell reopened this Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants