Closed manferlo81 closed 4 years ago
This is intended behavior. The spread operator will create a new object.
I think this is a valid issue — the second line should allocate exactly one object, but it allocates two ({}
and {name: "john"}
).
Or at least the behavior is correct, but we could avoid redundant allocation to improve performance of generated code.
Ah, I see, I was looking at line 3. Line 2 could definitely be optimized.
I believe this is not the intended behavior, if it is, please just close this issue.
I setup this example to show my point, this is not a real life example.
I am getting...
I believe
obj1
should be...see here...