File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export function isVueComponent(c: any): boolean {
3333 return true
3434 }
3535
36- if ( c === null || typeof c !== 'object' ) {
36+ if ( ! isPlainObject ( c ) ) {
3737 return false
3838 }
3939
@@ -63,7 +63,7 @@ export function componentNeedsCompiling(component: Component): boolean {
6363
6464export function isRefSelector ( refOptionsObject : any ) : boolean {
6565 if (
66- typeof refOptionsObject !== 'object' ||
66+ ! isPlainObject ( refOptionsObject ) ||
6767 Object . keys ( refOptionsObject || { } ) . length !== 1
6868 ) {
6969 return false
@@ -73,7 +73,7 @@ export function isRefSelector(refOptionsObject: any): boolean {
7373}
7474
7575export function isNameSelector ( nameOptionsObject : any ) : boolean {
76- if ( typeof nameOptionsObject !== 'object' || nameOptionsObject === null ) {
76+ if ( ! isPlainObject ( nameOptionsObject ) ) {
7777 return false
7878 }
7979
@@ -89,7 +89,7 @@ export function isDynamicComponent(c: any) {
8989}
9090
9191export function isComponentOptions ( c : any ) {
92- return c !== null && typeof c === 'object' && ( c . template || c . render )
92+ return isPlainObject ( c ) && ( c . template || c . render )
9393}
9494
9595export function isFunctionalComponent ( c : any ) {
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
1919 warnDeprecated ,
2020 isVueWrapper
2121} from 'shared/util'
22+ import { isPlainObject } from 'shared/validators'
2223import { isElementVisible } from 'shared/is-visible'
2324import find from './find'
2425import createWrapper from './create-wrapper'
@@ -719,8 +720,7 @@ export default class Wrapper implements BaseWrapper {
719720 Object . keys ( data ) . forEach ( key => {
720721 // Don't let people set entire objects, because reactivity won't work
721722 if (
722- typeof data [ key ] === 'object' &&
723- data [ key ] !== null &&
723+ isPlainObject ( data [ key ] ) &&
724724 // $FlowIgnore : Problem with possibly null this.vm
725725 data [ key ] === this . vm [ key ]
726726 ) {
You can’t perform that action at this time.
0 commit comments