-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
[Vapor] Incorrect merging of single prototype method called in various signatures #14244
Copy link
Copy link
Closed
Labels
🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.scope: compilerscope: vaporrelated to vapor moderelated to vapor mode
Description
Vue version
3.6.0-beta.1
Link to minimal reproduction
Steps to reproduce
1. Open the link
2. There is an error
(3. Uncomment or comment out to check error)
(4. Remove vapor attribute in script tag to check no error)
What is expected?
No error
Functions should not be merged like:
const _id = $props.id
_setProp(n0, "name", _id.replace('b', 'a'))
_setValue(n0, `${_id.replace('b', 'a')}def`)or same call signature in template literals, result is still merged like:
const __id_replace = $props.id.replace('b', 'a')
_setProp(n0, "name", __id_replace)
_setValue(n0, `${__id_replace}def`)What is actually happening?
On Firefox, it throws error: String.prototype.replace called on incompatible undefined
On Chrome, it throws error: String.prototype.replace called on null or undefined or _id_replace is not a function
(followed by Cannot read properties of null (reading 'parent'))
Functions is wrongly merged like:
const _id_replace = $props.id.replace
_setProp(n0, "name", _id_replace('b', 'a'))
_setValue(n0, `${_id_replace('b', 'a')}def`)System Info
Any additional comments?
Other String prototype methods are similar
Probably not specific to String prototype, more general
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.scope: compilerscope: vaporrelated to vapor moderelated to vapor mode