Exemplo n.º 1
0
ReferenceList StringInstanceImp::propList(ExecState *exec, bool recursive)
{
  ReferenceList properties = ObjectImp::propList(exec,recursive);

  UString str = internalValue().toString(exec);
  for (int i = 0; i < str.size(); i++)
    if (!ObjectImp::hasProperty(exec,Identifier::from(i)))
      properties.append(Reference(this, i));

  return properties;
}
ReferenceList ArrayInstanceImp::propList(ExecState *exec, bool recursive)
{
  ReferenceList properties = ObjectImp::propList(exec,recursive);

  // avoid fetching this every time through the loop
  ValueImp *undefined = UndefinedImp::staticUndefined;

  for (unsigned i = 0; i < storageLength; ++i) {
    ValueImp *imp = storage[i];
    if (imp && imp != undefined) {
      properties.append(Reference(this, i));
    }
  }
  return properties;
}