Skip to content

Use Object.assign() for send() options#968

Merged
lpinca merged 1 commit intowebsockets:masterfrom
Nibbler999:object-assign-options
Jan 14, 2017
Merged

Use Object.assign() for send() options#968
lpinca merged 1 commit intowebsockets:masterfrom
Nibbler999:object-assign-options

Conversation

@Nibbler999
Copy link
Copy Markdown

This avoids mutating the passed in arguments.

The current behaviour breaks sending if you use the same options object for multiple send() calls. I don't know if anyone relies on the arguments being mutated or in being able to pass in undefined explicitly.

This avoids mutating the passed in arguments
@lpinca
Copy link
Copy Markdown
Member

lpinca commented Jan 14, 2017

LGTM, it should still work when using undefined and I'm +1 for not mutating the options object.
Is there any performance impact? I guess it's irrelevant.

@lpinca lpinca merged commit bd41a05 into websockets:master Jan 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants