Skip to content

Commit

Permalink
Fix array observation on IE by using Array.isArray.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Oct 11, 2013
1 parent ffc0a86 commit 9637d42
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/instance/properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9637d42

Please sign in to comment.