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

Could an update be needed for globalsAllowList #9027

Open
0o001 opened this issue Aug 23, 2023 · 4 comments
Open

Could an update be needed for globalsAllowList #9027

0o001 opened this issue Aug 23, 2023 · 4 comments
Labels
🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. scope: compiler ✨ feature request New feature or request

Comments

@0o001
Copy link

0o001 commented Aug 23, 2023

What problem does this feature solve?

https://github.com/vuejs/core/blob/main/packages/shared/src/globalsAllowList.ts#L3

What does the proposed API look like?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects

Symbol etc.

@0o001 0o001 added the ✨ feature request New feature or request label Aug 23, 2023
@LinusBorg
Copy link
Member

Why?

@sxzz
Copy link
Member

sxzz commented Aug 24, 2023

I think it's a reasonable request.

As Evan said

The template global whitelist has always only included language-level globals (as defined in ECMA-262)

So maybe we can add all of the standard built-in objects. Otherwise, it is difficult to explain why Object, Boolean, String, RegExp, BigInt can be used in the template, but Symbol cannot.

@LinusBorg
Copy link
Member

Symbol itself may be a valuable addition. I was kinda interested in the "etc.", wether there are additional things OP wants to include and why.

@0o001
Copy link
Author

0o001 commented Aug 24, 2023

Symbol itself may be a valuable addition. I was kinda interested in the "etc.", wether there are additional things OP wants to include and why.

Although I'm not certain, I had thought that in addition to Symbol, globalThis, Reflect, WeakMap, and WeakSet could also be included. Also, the reason I shared the MDN link was for you to be able to check if there was anything else that I might have missed or that you would like to add.

@sodatea sodatea added 🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. scope: compiler labels Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. scope: compiler ✨ feature request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants