コード例 #1
0
ファイル: qsobject.cpp プロジェクト: miguelet17/eneboo
// ECMA 8.6.2.6 (new draft)
QSObject Imp::defaultValue(const QSObject *o, Type hint) const
{
#if 0
  QSObject obj;

  /* TODO String on Date object */
  if (hint != StringType && hint != NumberType)
    hint = NumberType;

  if (hint == StringType)
    obj = get(o, "toString");
  else
    obj = get(o, "valueOf");

  Imp *that = (Imp *)this;
  if (obj.isExecutable()) {   // spec says "not primitive type" but ...
    FunctionImp *f = (FunctionImp *)obj.imp();
    QSObject t(that);
    QSObject s = f->executeCall(&t, 0);
    if (!s.isObject())
      return s;
  }

  if (hint == StringType)
    obj = get(o, "valueOf");
  else
    obj = get(o, "toString");

  if (obj.isExecutable()) {
    FunctionImp *f = (FunctionImp *)obj.imp();
    QSObject t(that);
    QSObject s = f->executeCall(&t, 0);
    if (!s.isObject())
      return s;
  }
#endif
  return Error::create(TypeError, "No default value");
}
コード例 #2
0
ファイル: qstypes.cpp プロジェクト: AliYousuf/abanq-port
void QSList::remove( const QSObject &obj )
{
    if ( !obj.isValid() )
	return;
#if 0 // ###
    ListNode *n = hook->next;
    while ( n != hook ) {
	if ( n->member.imp() == obj.imp() ) {
	    erase( n );
	    return;
	}
	n = n->next;
    }
#endif
}