You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the heads up. I think being correct would be best. My biggest concern is causing a performance regression, since this is very performance-sensitive (see #951).
However, my manual implementation of copying properties over one-by-one is actually faster than Object.assign. I didn't expect that. So I guess I should go ahead with the manual implementation.
Here's my straightforward implementation in esbuild's existing runtime code style (i.e. optimizing for minified code size):
The recent change b1a394b to down-level object spread for V8 based targets is not consistent with ES.
Example:
Expected result:
The result above matches Chrome, Firefox and the
@babel/plugin-proposal-object-rest-spread
default setting ofloose: false
.Actual esbuild result:
The incorrect result matches Babel's "loose" mode for an ES6 target which also uses
Object.assign
.If the
Object.assign
behavior is desirable for object spreads then this issue could be resolved with documentation alone.Here's an example adapted from the Babel test suite highlighting other corner cases of object spread:
Expected:
Actual:
The text was updated successfully, but these errors were encountered: