Evan You 11 years ago
parent
commit
42e08352c2
4 changed files with 27 additions and 2 deletions
  1. 5 2
      src/observer/observer.js
  2. 0 0
      src/parsers/template.js
  3. 10 0
      src/template.js
  4. 12 0
      test/unit/observer.js

+ 5 - 2
src/observer/observer.js

@@ -96,6 +96,7 @@ p.init = function () {
 p.walk = function (obj) {
   var key, val
   for (key in obj) {
+    if (!obj.hasOwnProperty(key)) return
     val = obj[key]
     this.observe(key, val)
     this.convert(key, val)
@@ -202,8 +203,10 @@ p.unlink = function (items) {
  * during init; for already observed ones we can skip the initialization,
  * but still need to emit the values.
  *
- * @param {String} key
- * @param {*} val
+ * If called with no arguments, it delivers set events for the root value.
+ *
+ * @param {String} [key]
+ * @param {*} [val]
  */
 
 p.deliver = function (key, val) {

+ 0 - 0
src/parsers/template.js


+ 10 - 0
src/template.js

@@ -0,0 +1,10 @@
+/**
+ * The Template class encapsulates the logic of template
+ * caching, instantiation, parsing and transclusion.
+ */
+
+function Template () {
+  
+}
+
+module.exports = Template

+ 12 - 0
test/unit/observer.js

@@ -25,4 +25,16 @@ describe('Observer', function () {
     expect(spy).toHaveBeenCalledWith('b' + delimiter + 'c', 4, undefined)
   })
 
+  it('should emit get events', function () {
+    // body...
+  })
+
+  it('should emit mutation events on Array mutation', function () {
+    // body...
+  })
+
+  it('should emit ', function () {
+    // body...
+  })
+
 })