Skip to content
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

fix(create-instance): revert stubbing of component _Ctor #1479

Merged
merged 1 commit into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions packages/create-instance/create-component-stubs.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,9 @@ function resolveOptions(component, _Vue) {
return {}
}

if (isConstructor(component)) {
return component.options
}
const options = _Vue.extend(component).options
component._Ctor = {}

return options
return isConstructor(component)
? component.options
: _Vue.extend(component).options
}

function getScopedSlotRenderFunctions(ctx: any): Array<string> {
Expand Down
1 change: 0 additions & 1 deletion packages/create-instance/create-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export default function createInstance(

// make sure all extends are based on this instance
const Constructor = _Vue.extend(componentOptions).extend(instanceOptions)
componentOptions._Ctor = {}
Constructor.options._base = _Vue

const scopedSlots = createScopedSlots(options.scopedSlots, _Vue)
Expand Down
1 change: 0 additions & 1 deletion packages/create-instance/patch-create-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ function shouldExtend(component, _Vue) {
function extend(component, _Vue) {
const componentOptions = component.options ? component.options : component
const stub = _Vue.extend(componentOptions)
componentOptions._Ctor = {}
stub.options.$_vueTestUtils_original = component
stub.options._base = _Vue
return stub
Expand Down