Skip to content

Spread arguments in new call don't work in TS 1.4 #3766

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

Closed
yukulele opened this issue Jul 7, 2015 · 2 comments
Closed

Spread arguments in new call don't work in TS 1.4 #3766

yukulele opened this issue Jul 7, 2015 · 2 comments
Labels
Duplicate An existing issue was already created Fixed A PR has been merged for this issue

Comments

@yukulele
Copy link

yukulele commented Jul 7, 2015

Array literal (rest parameter) don't seem to work with constructor

example:

let a = [1, 2, ...arr, 4, 5]; //works
Math.max(...arr); //works
myFunction(...arr); //works
new myClass(...arr); //error
@yukulele yukulele changed the title rest parametre on constructor array literal on constructor Jul 7, 2015
@qc00
Copy link

qc00 commented Jul 7, 2015

Should work with ES5 target, see #2369

@DanielRosenwasser DanielRosenwasser added the Duplicate An existing issue was already created label Jul 7, 2015
@DanielRosenwasser DanielRosenwasser changed the title array literal on constructor Spread arguments in new call don't work in TS 1.4 Jul 7, 2015
@DanielRosenwasser
Copy link
Member

Yup, @tinganho fixed this one. Thanks guys!

@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label Jul 7, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants