Skip to content

Commit

Permalink
use Object.assign()
Browse files Browse the repository at this point in the history
  • Loading branch information
38elements committed Apr 4, 2018
1 parent 37c5950 commit 3c841a1
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions packages/create-instance/create-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ import deleteoptions from './delete-mounting-options'
import createFunctionalComponent from './create-functional-component'
import { componentNeedsCompiling } from 'shared/validators'

function extend (to: Object, _from: ?Object): Object {
for (const key in _from) {
to[key] = _from[key]
}
return to
}

export default function createInstance (
component: Component,
options: Options,
Expand Down Expand Up @@ -74,7 +67,7 @@ export default function createInstance (
vm._renderProxy._t = function (name, feedback, props, bindObject) {
const scopedSlotFn = vm.$_VueTestUtils_scopedSlots[name]
if (scopedSlotFn) {
props = extend(extend({}, bindObject), props)
props = Object.assign(Object.assign({}, bindObject), props)

This comment has been minimized.

Copy link
@eddyerburgh

eddyerburgh Apr 5, 2018

Member

You can use the spread operator here

This comment has been minimized.

Copy link
@38elements

38elements Apr 5, 2018

Author Contributor

This line has already been changed at e6ad08d

props = Object.assign({}, bindObject, props)

This comment has been minimized.

Copy link
@eddyerburgh

eddyerburgh Apr 5, 2018

Member

You can use the object spread operator instead of object assign

This comment has been minimized.

Copy link
@38elements

38elements Apr 5, 2018

Author Contributor

I changed the line.

vm._renderProxy.props = props
return scopedSlotFn.call(vm._renderProxy)
} else {
Expand Down

0 comments on commit 3c841a1

Please sign in to comment.