From 0ac1ea1b554e9ecf4b49b3661636d3264ce5158a Mon Sep 17 00:00:00 2001 From: Rafael Weinstein Date: Wed, 11 Sep 2013 17:56:53 -0700 Subject: [PATCH] setValueFrom must check isObject as it traverse path and sets value (fixes Safari failure) R=arv BUG= Review URL: https://codereview.appspot.com/13306052 --- src/observe.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/observe.js b/src/observe.js index 07d6829..918b55c 100644 --- a/src/observe.js +++ b/src/observe.js @@ -206,15 +206,15 @@ return false; for (var i = 0; i < this.length - 1; i++) { - if (obj === undefined || obj === null) + if (!isObject(obj)) return false; obj = obj[this[i]]; } - if (obj === undefined || obj === null) + if (!isObject(obj)) return false; - obj[this[this.length - 1]] = value; + obj[this[i]] = value; return true; } });