8000 Update: lang/isObject must return {Boolen}; lang/isArray more faster now · mikehins/vue@e3c9363 · GitHub
[go: up one dir, main page]

Skip to content

Commit e3c9363

Browse files
committed
Update: lang/isObject must return {Boolen}; lang/isArray more faster now
1 parent 098a3cd commit e3c9363

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/util/lang.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ exports.extend = function (to, from) {
157157
*/
158158

159159
exports.isObject = function (obj) {
160-
return obj && typeof obj === 'object'
160+
return obj !== null && typeof obj === 'object'
161161
}
162162

163163
/**
@@ -180,9 +180,7 @@ exports.isPlainObject = function (obj) {
180180
* @return {Boolean}
181181
*/
182182

183-
exports.isArray = function (obj) {
184-
return Array.isArray(obj)
185-
}
183+
exports.isArray = Array.isArray
186184

187185
/**
188186
* Define a non-enumerable property

src/watcher.js

7C8C
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ p.run = function () {
179179
var value = this.get()
180180
if (
181181
value !== this.value ||
182-
Array.isArray(value) ||
182+
_.isArray(value) ||
183183
this.deep
184184
) {
185185
var oldValue = this.value

0 commit comments

Comments
 (0)
0