Permalink
Browse files

- use `defineProperty` for __REF_ADR__ where available to prevent pol…

…lution
  • Loading branch information...
1 parent 99b6455 commit 481c2eaa1826e43ec497cee4719f7305414404a1 Nickolay Platonov committed Dec 16, 2010
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/Data/Visitor.js
View
@@ -151,7 +151,12 @@ body : function () {
assignRefAdrTo : function (object) {
- if (!object.__REFADR__) object.__REFADR__ = this.getRefAdrFor(object)
+ if (!object.__REFADR__)
+ if (Object.defineProperty)
+ Object.defineProperty(object, '__REFADR__', { value : this.getRefAdrFor(object) })
+ else
+ object.__REFADR__ = this.getRefAdrFor(object)
+
return object.__REFADR__
}

0 comments on commit 481c2ea

Please sign in to comment.