Skip to content

Commit fd0113c

Browse files
committed
Merge pull request #937 from nervgh/lang-update
Update: lang/isObject must return {Boolen}; lang/isArray more faster now
2 parents 2eedc8d + e3c9363 commit fd0113c

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
@@ -172,7 +172,7 @@ exports.extend = function (to, from) {
172172
*/
173173

174174
exports.isObject = function (obj) {
175-
return obj && typeof obj === 'object'
175+
return obj !== null && typeof obj === 'object'
176176
}
177177

178178
/**
@@ -195,9 +195,7 @@ exports.isPlainObject = function (obj) {
195195
* @return {Boolean}
196196
*/
197197

198-
exports.isArray = function (obj) {
199-
return Array.isArray(obj)
200-
}
198+
exports.isArray = Array.isArray
201199

202200
/**
203201
* Define a non-enumerable property

src/watcher.js

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)