-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Spread operator in method shorthand in object literal is not emitted with "__assign" #17087
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
Comments
I think it's supposed to be: const y = {
prop: "ms"
}
const x = {
...y,
...((options) => {
return {
timestamps: false,
...options
}
})({new: 'old',})
} or const y = {
prop: "ms"
}
const x = {
...y,
...fn({}),
}
function fn(options) {
return {
timestamps: false,
...options
}
} |
The issue happens when using method shorthand in object literal |
This seems to happen when their is a spread in the directly enclosing literal only. This works const x = {
fn() {
return {
...{}
};
}
} and this fails const x = {
...{},
fn() {
return {
...{}
};
}
} but this works const x = {
...{},
y: {
fn() {
return {
...{}
};
}
}
} |
I just realized this is a dupe of #16765 |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
Uh oh!
There was an error while loading. Please reload this page.
TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx)
Link to playground
Code
Emits to:
Expected behavior:
"...options" will be emitted with "__assign"
Actual behavior:
"...options" is not emitted with "__assign"
The text was updated successfully, but these errors were encountered: