From 9637d42ad231a2090645c400302c699aa1da07b7 Mon Sep 17 00:00:00 2001 From: Steve Orvell Date: Fri, 11 Oct 2013 16:30:13 -0700 Subject: [PATCH] Fix array observation on IE by using Array.isArray. --- src/instance/properties.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/instance/properties.js b/src/instance/properties.js index 3b9a4bd7ba..dbec0aa075 100644 --- a/src/instance/properties.js +++ b/src/instance/properties.js @@ -84,12 +84,12 @@ var callbackName = this.observe[name]; if (callbackName) { // if we are observing the previous value, stop - if (isArray(old)) { + if (Array.isArray(old)) { log.observe && console.log('[%s] observeArrayValue: unregister observer [%s]', this.localName, name); unregisterObserver(this, name + '__array'); } // if the new value is an array, being observing it - if (isArray(value)) { + if (Array.isArray(value)) { log.observe && console.log('[%s] observeArrayValue: register observer [%s]', this.localName, name, value); var self = this; var observer = new ArrayObserver(value, function(value, old) { @@ -127,10 +127,6 @@ } }; - function isArray(obj) { - return toString.call(obj) === "[object Array]"; - }; - // property binding // bind a property in A to a path in B by converting A[property] to a