Skip to content

es6 transforms bug(Rest Params) #853

Description

@magicismight
functionpush(array, ...items){array.push(...items);}

The code above will throw an SyntaxError
Unexpected keyword 'var'.Expected an opening '{' at the start of a function body.

But if I write rest params separately,they are just fine.

functionpush(array, ...items){array.push.apply(array,items);}

OR

functionpush(array){varargs=[].slice.call(arguments);array.push.call(...args);}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions