changeset 28:64de55cd54a4

Changed getProperty() of SafeWrapper.
author Atul Varma <varmaa@toolness.com>
date Mon, 22 Jun 2009 11:11:41 -0700
parents 69622f55fcf6
children b20aeecb6499
files tcb.js
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
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() {