Mercurial > spidermonkey-playground
diff tcb.js @ 28:64de55cd54a4
Changed getProperty() of SafeWrapper.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Mon, 22 Jun 2009 11:11:41 -0700 |
parents | 69622f55fcf6 |
children | 82d800f2dcfc |
line wrap: on
line diff
--- a/tcb.js Mon Jun 22 10:59:51 2009 -0700 +++ b/tcb.js Mon Jun 22 11:11:41 2009 -0700 @@ -120,13 +120,15 @@ }, getProperty: function(wrappee, wrapper, id, defaultValue) { - if (id && id != "prototype" && id[0] != "_") { - if (defaultValue === undefined) { - defaultValue = lookupProperty(wrappee, id); - } - return this._maybeWrap(defaultValue); + switch (id) { + case "prototype": + case "caller": + case "__proto__": + case "__parent__": + return null; + default: + return this._maybeWrap(lookupProperty(wrappee, id)); } - return undefined; }, setProperty: function() {