Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
rivets
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
7ad15ba1
authored
2013-08-11 14:47:42 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Define the _rv object id as a non-enumerable, non-configurable, non-writable property on the object.
1 parent
5cc3bd74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
src/adapters.coffee
src/adapters.coffee
View file @
7ad15ba
...
...
@@ -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
]]
...
...
Please
register
or
sign in
to post a comment