diff --git a/src/observer/index.js b/src/observer/index.js index a1198ccb..c7b55ca7 100644 --- a/src/observer/index.js +++ b/src/observer/index.js @@ -3,6 +3,7 @@ import { arrayMethods } from './array' import { def, isArray, + isObject, isPlainObject, hasProto, hasOwn @@ -160,7 +161,7 @@ function copyAugment (target, src, keys) { */ export function observe (value, vm) { - if (!value || typeof value !== 'object') { + if (!isObject(value)) { return } var ob diff --git a/src/vdom/modules/class.js b/src/vdom/modules/class.js index 33774ddd..d2822b94 100644 --- a/src/vdom/modules/class.js +++ b/src/vdom/modules/class.js @@ -1,10 +1,10 @@ -import { isArray, setClass } from '../../util/index' +import { isArray, isObject, setClass } from '../../util/index' function genClass (data) { if (!data) { return '' } - if (typeof data === 'object') { + if (isObject(data)) { let res = '' for (var key in data) { if (data[key]) res += key + ' '