fix(runtime-core): do not warn Symbol.unscopables access
#11283
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.
Fixes #7910
Related #1731, #2910 comment
Explanation:
Generated render function uses
withstatement to wrap its contents in some conditions. Example:As
_ctxis aProxyinsidewithstatement, it, on the first time, traps access toSymbol.unscopablesand only then the actual property. You can see thatProxyHandlersgetSymbol.unscopablesas the key on the screenshot below:To reproduce these steps you can place a debugger in the warning message in the Stackblitz reproduction.
Why this should be fixed
This warning is unrelated to user code and makes lots of noise when a compiled template has a lot of proxy property access
StackBlitz Reproduction
Simple HTML page reproduction:
Test.html