7ad15ba1 by Michael Richards

Define the _rv object id as a non-enumerable, non-configurable, non-writable property on the object.

1 parent 5cc3bd74
...@@ -8,8 +8,15 @@ Rivets.adapters['.'] = ...@@ -8,8 +8,15 @@ Rivets.adapters['.'] =
8 8
9 subscribe: (obj, keypath, callback) -> 9 subscribe: (obj, keypath, callback) ->
10 unless obj[@id]? 10 unless obj[@id]?
11 obj[@id] = @counter++ 11 id = @counter++
12 @weakmap[obj[@id]] = {} 12
13 Object.defineProperty obj, @id,
14 enumerable: false
15 configurable: false
16 writable: false
17 value: id
18
19 @weakmap[id] = {}
13 20
14 map = @weakmap[obj[@id]] 21 map = @weakmap[obj[@id]]
15 22
......