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['.'] =
subscribe: (obj, keypath, callback) ->
unless obj[@id]?
obj[@id] = @counter++
@weakmap[obj[@id]] = {}
id = @counter++
Object.defineProperty obj, @id,
enumerable: false
configurable: false
writable: false
value: id
@weakmap[id] = {}
map = @weakmap[obj[@id]]
......