From e3d8976274aea90d8ea764a9d8cfbbbd88a6e98c Mon Sep 17 00:00:00 2001 From: hns Date: Fri, 14 Jan 2005 13:46:53 +0000 Subject: [PATCH] Always return empty array for propery enumerations on HopObject prototypes. This is to stop prototype properties from showing up in HopObject proprerty enumerations. HopObject.getAllIds() can be used to get a prototypes properties. --- src/helma/scripting/rhino/HopObject.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/helma/scripting/rhino/HopObject.java b/src/helma/scripting/rhino/HopObject.java index fcba8c8d..27886abb 100644 --- a/src/helma/scripting/rhino/HopObject.java +++ b/src/helma/scripting/rhino/HopObject.java @@ -910,7 +910,10 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco */ public Object[] getIds() { if (node == null) { - return super.getIds(); + // HopObject prototypes always return an empty array in order not to + // pollute actual HopObjects properties. Call getAllIds() to get + // a list of properties from a HopObject prototype. + return new Object[0]; } checkNode();