+2006-10-31 Vladimir Olexa <vladimir.olexa@gmail.com>
+
+ Reviewed by Geoff.
+
+ http://bugs.webkit.org/show_bug.cgi?id=4166
+ Function object does not support caller property
+
+ Test: fast/js/caller-property.html
+
+ * kjs/function.cpp:
+ (KJS::FunctionImp::callerGetter): added
+ (KJS::FunctionImp::getOwnPropertySlot): added if statement to handle callerGetter()
+ * kjs/function.h: added callerGetter() declaration
+ * kjs/identifier.h: added caller property macro
+ * tests/mozilla/expected.html:
+
2006-10-30 Kevin McCullough <KMcCullough@apple.com>
Reviewed by Adam.
class Parameter {
public:
Parameter() {};
- Parameter(const Identifier &n) : name(n) { }
+ Parameter(const Identifier& n) : name(n) { }
Identifier name;
};
-FunctionImp::FunctionImp(ExecState *exec, const Identifier &n, FunctionBodyNode* b)
+FunctionImp::FunctionImp(ExecState* exec, const Identifier& n, FunctionBodyNode* b)
: InternalFunctionImp(static_cast<FunctionPrototype*>
(exec->lexicalInterpreter()->builtinFunctionPrototype()), n)
, body(b)
{
}
-JSValue *FunctionImp::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
+JSValue* FunctionImp::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
{
- JSObject *globalObj = exec->dynamicInterpreter()->globalObject();
+ JSObject* globalObj = exec->dynamicInterpreter()->globalObject();
// enter a new execution context
Context ctx(globalObj, exec->dynamicInterpreter(), thisObj, body.get(),
// add variable declarations (initialized to undefined)
processVarDecls(&newExec);
- Debugger *dbg = exec->dynamicInterpreter()->debugger();
+ Debugger* dbg = exec->dynamicInterpreter()->debugger();
int sid = -1;
int lineno = -1;
if (dbg) {
return jsUndefined();
}
-void FunctionImp::addParameter(const Identifier &n)
+void FunctionImp::addParameter(const Identifier& n)
{
if (!parameters)
parameters.set(new Vector<Parameter>);
// ECMA 10.1.3q
-void FunctionImp::processParameters(ExecState *exec, const List &args)
+void FunctionImp::processParameters(ExecState* exec, const List& args)
{
if (!parameters)
return;
ListIterator it = args.begin();
- JSValue *v = *it;
+ JSValue * v = *it;
for (size_t i = 0; i < parameters->size(); ++i) {
if (it != args.end()) {
#ifdef KJS_VERBOSE
{
}
-JSValue *FunctionImp::argumentsGetter(ExecState* exec, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
+JSValue* FunctionImp::argumentsGetter(ExecState* exec, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
{
- FunctionImp *thisObj = static_cast<FunctionImp *>(slot.slotBase());
- Context *context = exec->m_context;
+ FunctionImp* thisObj = static_cast<FunctionImp*>(slot.slotBase());
+ Context* context = exec->m_context;
while (context) {
if (context->function() == thisObj) {
- return static_cast<ActivationImp *>(context->activationObject())->get(exec, propertyName);
+ return static_cast<ActivationImp*>(context->activationObject())->get(exec, propertyName);
}
context = context->callingContext();
}
return jsNull();
}
-JSValue *FunctionImp::lengthGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot& slot)
+JSValue* FunctionImp::callerGetter(ExecState* exec, JSObject*, const Identifier&, const PropertySlot& slot)
{
- FunctionImp *thisObj = static_cast<FunctionImp *>(slot.slotBase());
+ FunctionImp* thisObj = static_cast<FunctionImp* >(slot.slotBase());
+ Context* context = exec->m_context;
+ while (context) {
+ if (context->function() == thisObj)
+ return (context->callingContext()->function()) ? context->callingContext()->function() : jsNull();
+
+ context = context->callingContext();
+ }
+ return jsNull();
+}
+
+JSValue* FunctionImp::lengthGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot& slot)
+{
+ FunctionImp* thisObj = static_cast<FunctionImp*>(slot.slotBase());
return jsNumber(thisObj->parameters ? thisObj->parameters->size() : 0);
}
-bool FunctionImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool FunctionImp::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
// Find the arguments from the closest context.
if (propertyName == exec->dynamicInterpreter()->argumentsIdentifier()) {
slot.setCustom(this, argumentsGetter);
return true;
}
-
+
// Compute length of parameters.
if (propertyName == lengthPropertyName) {
slot.setCustom(this, lengthGetter);
return true;
}
-
+
+ if (propertyName == callerPropertyName) {
+ slot.setCustom(this, callerGetter);
+ return true;
+ }
+
return InternalFunctionImp::getOwnPropertySlot(exec, propertyName, slot);
}
-void FunctionImp::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
+void FunctionImp::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr)
{
if (propertyName == exec->dynamicInterpreter()->argumentsIdentifier() || propertyName == lengthPropertyName)
return;
InternalFunctionImp::put(exec, propertyName, value, attr);
}
-bool FunctionImp::deleteProperty(ExecState *exec, const Identifier &propertyName)
+bool FunctionImp::deleteProperty(ExecState* exec, const Identifier& propertyName)
{
if (propertyName == exec->dynamicInterpreter()->argumentsIdentifier() || propertyName == lengthPropertyName)
return false;
// ### is "Function" correct here?
const ClassInfo DeclaredFunctionImp::info = {"Function", &FunctionImp::info, 0, 0};
-DeclaredFunctionImp::DeclaredFunctionImp(ExecState *exec, const Identifier &n,
- FunctionBodyNode *b, const ScopeChain &sc)
+DeclaredFunctionImp::DeclaredFunctionImp(ExecState* exec, const Identifier& n,
+ FunctionBodyNode* b, const ScopeChain& sc)
: FunctionImp(exec, n, b)
{
setScope(sc);
}
// ECMA 13.2.2 [[Construct]]
-JSObject *DeclaredFunctionImp::construct(ExecState *exec, const List &args)
+JSObject* DeclaredFunctionImp::construct(ExecState* exec, const List& args)
{
- JSObject *proto;
- JSValue *p = get(exec,prototypePropertyName);
+ JSObject* proto;
+ JSValue* p = get(exec,prototypePropertyName);
if (p->isObject())
proto = static_cast<JSObject*>(p);
else
proto = exec->lexicalInterpreter()->builtinObjectPrototype();
- JSObject *obj(new JSObject(proto));
+ JSObject* obj(new JSObject(proto));
- JSValue *res = call(exec,obj,args);
+ JSValue* res = call(exec,obj,args);
if (res->isObject())
- return static_cast<JSObject *>(res);
+ return static_cast<JSObject*>(res);
else
return obj;
}
-Completion DeclaredFunctionImp::execute(ExecState *exec)
+Completion DeclaredFunctionImp::execute(ExecState* exec)
{
Completion result = body->execute(exec);
return Completion(Normal, jsUndefined()); // TODO: or ReturnValue ?
}
-void DeclaredFunctionImp::processVarDecls(ExecState *exec)
+void DeclaredFunctionImp::processVarDecls(ExecState* exec)
{
body->processVarDecls(exec);
}
// We use Identifier::null to indicate that a given argument's value
// isn't stored in the activation object.
-IndexToNameMap::IndexToNameMap(FunctionImp *func, const List &args)
+IndexToNameMap::IndexToNameMap(FunctionImp* func, const List& args)
{
_map = new Identifier[args.size()];
this->size = args.size();
delete [] _map;
}
-bool IndexToNameMap::isMapped(const Identifier &index) const
+bool IndexToNameMap::isMapped(const Identifier& index) const
{
bool indexIsNumber;
int indexAsNumber = index.toUInt32(&indexIsNumber);
return true;
}
-void IndexToNameMap::unMap(const Identifier &index)
+void IndexToNameMap::unMap(const Identifier& index)
{
bool indexIsNumber;
int indexAsNumber = index.toUInt32(&indexIsNumber);
return _map[index];
}
-Identifier& IndexToNameMap::operator[](const Identifier &index)
+Identifier& IndexToNameMap::operator[](const Identifier& index)
{
bool indexIsNumber;
int indexAsNumber = index.toUInt32(&indexIsNumber);
const ClassInfo Arguments::info = {"Arguments", 0, 0, 0};
// ECMA 10.1.8
-Arguments::Arguments(ExecState *exec, FunctionImp *func, const List &args, ActivationImp *act)
+Arguments::Arguments(ExecState* exec, FunctionImp* func, const List& args, ActivationImp* act)
: JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()),
_activationObject(act),
indexToNameMap(func, args)
_activationObject->mark();
}
-JSValue *Arguments::mappedIndexGetter(ExecState* exec, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
+JSValue* Arguments::mappedIndexGetter(ExecState* exec, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
{
- Arguments *thisObj = static_cast<Arguments *>(slot.slotBase());
+ Arguments* thisObj = static_cast<Arguments*>(slot.slotBase());
return thisObj->_activationObject->get(exec, thisObj->indexToNameMap[propertyName]);
}
-bool Arguments::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool Arguments::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
if (indexToNameMap.isMapped(propertyName)) {
slot.setCustom(this, mappedIndexGetter);
return JSObject::getOwnPropertySlot(exec, propertyName, slot);
}
-void Arguments::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
+void Arguments::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr)
{
if (indexToNameMap.isMapped(propertyName)) {
_activationObject->put(exec, indexToNameMap[propertyName], value, attr);
}
}
-bool Arguments::deleteProperty(ExecState *exec, const Identifier &propertyName)
+bool Arguments::deleteProperty(ExecState* exec, const Identifier& propertyName)
{
if (indexToNameMap.isMapped(propertyName)) {
indexToNameMap.unMap(propertyName);
const ClassInfo ActivationImp::info = {"Activation", 0, 0, 0};
// ECMA 10.1.6
-ActivationImp::ActivationImp(FunctionImp *function, const List &arguments)
+ActivationImp::ActivationImp(FunctionImp* function, const List& arguments)
: _function(function), _arguments(true), _argumentsObject(0)
{
_arguments.copyFrom(arguments);
// FIXME: Do we need to support enumerating the arguments property?
}
-JSValue *ActivationImp::argumentsGetter(ExecState* exec, JSObject*, const Identifier&, const PropertySlot& slot)
+JSValue* ActivationImp::argumentsGetter(ExecState* exec, JSObject*, const Identifier&, const PropertySlot& slot)
{
- ActivationImp *thisObj = static_cast<ActivationImp *>(slot.slotBase());
+ ActivationImp* thisObj = static_cast<ActivationImp*>(slot.slotBase());
// default: return builtin arguments array
if (!thisObj->_argumentsObject)
return ActivationImp::argumentsGetter;
}
-bool ActivationImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
+bool ActivationImp::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
// do this first so property map arguments property wins over the below
// we don't call JSObject because we won't have getter/setter properties
// and we don't want to support __proto__
- if (JSValue **location = getDirectLocation(propertyName)) {
+ if (JSValue** location = getDirectLocation(propertyName)) {
slot.setValueSlot(this, location);
return true;
}
return false;
}
-bool ActivationImp::deleteProperty(ExecState *exec, const Identifier &propertyName)
+bool ActivationImp::deleteProperty(ExecState* exec, const Identifier& propertyName)
{
if (propertyName == exec->dynamicInterpreter()->argumentsIdentifier())
return false;
JSObject::mark();
}
-void ActivationImp::createArgumentsObject(ExecState *exec) const
+void ActivationImp::createArgumentsObject(ExecState* exec) const
{
- _argumentsObject = new Arguments(exec, _function, _arguments, const_cast<ActivationImp *>(this));
+ _argumentsObject = new Arguments(exec, _function, _arguments, const_cast<ActivationImp*>(this));
}
// ------------------------------ GlobalFunc -----------------------------------
return id == Eval ? EvalCode : codeType();
}
-static JSValue *encode(ExecState *exec, const List &args, const char *do_not_escape)
+static JSValue* encode(ExecState* exec, const List& args, const char* do_not_escape)
{
UString r = "", s, str = args[0]->toString(exec);
CString cstr = str.UTF8String();
- const char *p = cstr.c_str();
+ const char* p = cstr.c_str();
for (size_t k = 0; k < cstr.size(); k++, p++) {
char c = *p;
if (c && strchr(do_not_escape, c)) {
return jsString(r);
}
-static JSValue *decode(ExecState *exec, const List &args, const char *do_not_unescape, bool strict)
+static JSValue* decode(ExecState* exec, const List& args, const char* do_not_unescape, bool strict)
{
UString s = "", str = args[0]->toString(exec);
int k = 0, len = str.size();
- const UChar *d = str.data();
+ const UChar* d = str.data();
UChar u;
while (k < len) {
- const UChar *p = d + k;
+ const UChar* p = d + k;
UChar c = *p;
if (c == '%') {
int charLen = 0;
char sequence[5];
sequence[0] = b0;
for (int i = 1; i < sequenceLen; ++i) {
- const UChar *q = p + i * 3;
+ const UChar* q = p + i * 3;
if (q[0] == '%' && isxdigit(q[1].uc) && isxdigit(q[2].uc))
sequence[i] = Lexer::convertHex(q[1].uc, q[2].uc);
else {
return digit;
}
-static double parseInt(const UString &s, int radix)
+static double parseInt(const UString& s, int radix)
{
int length = s.size();
int p = 0;
return sign * number;
}
-static double parseFloat(const UString &s)
+static double parseFloat(const UString& s)
{
// Check for 0x prefix here, because toDouble allows it, but we must treat it as 0.
// Need to skip any whitespace and then one + or - sign.
return s.toDouble( true /*tolerant*/, false /* NaN for empty string */ );
}
-JSValue *GlobalFuncImp::callAsFunction(ExecState *exec, JSObject* /*thisObj*/, const List &args)
+JSValue* GlobalFuncImp::callAsFunction(ExecState* exec, JSObject* /*thisObj*/, const List& args)
{
- JSValue *res = jsUndefined();
+ JSValue* res = jsUndefined();
static const char do_not_escape[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
switch (id) {
case Eval: { // eval()
- JSValue *x = args[0];
+ JSValue* x = args[0];
if (!x->isString())
return x;
else {
UString errMsg;
RefPtr<ProgramNode> progNode(Parser::parse(UString(), 0, s.data(),s.size(),&sid,&errLine,&errMsg));
- Debugger *dbg = exec->dynamicInterpreter()->debugger();
+ Debugger* dbg = exec->dynamicInterpreter()->debugger();
if (dbg) {
bool cont = dbg->sourceParsed(exec, sid, UString(), s, 0, errLine, errMsg);
if (!cont)
return throwError(exec, SyntaxError, errMsg, errLine, sid, NULL);
// enter a new execution context
- JSObject *thisVal = static_cast<JSObject *>(exec->context()->thisValue());
+ JSObject* thisVal = static_cast<JSObject*>(exec->context()->thisValue());
Context ctx(exec->dynamicInterpreter()->globalObject(),
exec->dynamicInterpreter(),
thisVal,
case Escape:
{
UString r = "", s, str = args[0]->toString(exec);
- const UChar *c = str.data();
+ const UChar* c = str.data();
for (int k = 0; k < str.size(); k++, c++) {
int u = c->uc;
if (u > 255) {
UString s = "", str = args[0]->toString(exec);
int k = 0, len = str.size();
while (k < len) {
- const UChar *c = str.data() + k;
+ const UChar* c = str.data() + k;
UChar u;
if (*c == UChar('%') && k <= len - 6 && *(c+1) == UChar('u')) {
if (Lexer::isHexDigit((c+2)->uc) && Lexer::isHexDigit((c+3)->uc) &&
class FunctionImp : public InternalFunctionImp {
friend class ActivationImp;
public:
- FunctionImp(ExecState* exec, const Identifier& n, FunctionBodyNode* b);
+ FunctionImp(ExecState*, const Identifier& n, FunctionBodyNode* b);
virtual ~FunctionImp();
- virtual bool getOwnPropertySlot(ExecState *, const Identifier &, PropertySlot&);
- virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
- virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
+ virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ virtual void put(ExecState*, const Identifier& propertyName, JSValue* value, int attr = None);
+ virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
- virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
+ virtual JSValue* callAsFunction(ExecState*, JSObject* thisObj, const List& args);
- void addParameter(const Identifier &n);
+ void addParameter(const Identifier& n);
Identifier getParameterName(int index);
// parameters in string representation, e.g. (a, b, c)
UString parameterString() const;
virtual CodeType codeType() const = 0;
- virtual Completion execute(ExecState *exec) = 0;
+ virtual Completion execute(ExecState*) = 0;
- virtual const ClassInfo *classInfo() const { return &info; }
+ virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
RefPtr<FunctionBodyNode> body;
* @param exec The current execution state
* @return The function's scope
*/
- const ScopeChain &scope() const { return _scope; }
- void setScope(const ScopeChain &s) { _scope = s; }
+ const ScopeChain& scope() const { return _scope; }
+ void setScope(const ScopeChain& s) { _scope = s; }
virtual void mark();
protected:
private:
ScopeChain _scope;
- static JSValue *argumentsGetter(ExecState *, JSObject *, const Identifier &, const PropertySlot&);
- static JSValue *lengthGetter(ExecState *, JSObject *, const Identifier &, const PropertySlot&);
+ static JSValue* argumentsGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
+ static JSValue* callerGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
+ static JSValue* lengthGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
- void processParameters(ExecState *exec, const List &);
- virtual void processVarDecls(ExecState *exec);
+ void processParameters(ExecState*, const List&);
+ virtual void processVarDecls(ExecState*);
};
class DeclaredFunctionImp : public FunctionImp {
public:
- DeclaredFunctionImp(ExecState *exec, const Identifier &n,
- FunctionBodyNode *b, const ScopeChain &sc);
+ DeclaredFunctionImp(ExecState*, const Identifier& n,
+ FunctionBodyNode* b, const ScopeChain& sc);
bool implementsConstruct() const;
- JSObject *construct(ExecState *exec, const List &args);
+ JSObject* construct(ExecState*, const List& args);
- virtual Completion execute(ExecState *exec);
+ virtual Completion execute(ExecState*);
CodeType codeType() const { return FunctionCode; }
- virtual const ClassInfo *classInfo() const { return &info; }
+ virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
private:
- virtual void processVarDecls(ExecState *exec);
+ virtual void processVarDecls(ExecState*);
};
class IndexToNameMap {
public:
- IndexToNameMap(FunctionImp *func, const List &args);
+ IndexToNameMap(FunctionImp* func, const List& args);
~IndexToNameMap();
Identifier& operator[](int index);
Identifier& operator[](const Identifier &indexIdentifier);
- bool isMapped(const Identifier &index) const;
- void unMap(const Identifier &index);
+ bool isMapped(const Identifier& index) const;
+ void unMap(const Identifier& index);
private:
IndexToNameMap(); // prevent construction w/o parameters
int size;
- Identifier * _map;
+ Identifier* _map;
};
class Arguments : public JSObject {
public:
- Arguments(ExecState *exec, FunctionImp *func, const List &args, ActivationImp *act);
+ Arguments(ExecState*, FunctionImp* func, const List& args, ActivationImp* act);
virtual void mark();
- virtual bool getOwnPropertySlot(ExecState *, const Identifier &, PropertySlot&);
- virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
- virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
- virtual const ClassInfo *classInfo() const { return &info; }
+ virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ virtual void put(ExecState*, const Identifier& propertyName, JSValue* value, int attr = None);
+ virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
+ virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
private:
- static JSValue *mappedIndexGetter(ExecState *exec, JSObject *, const Identifier &, const PropertySlot& slot);
+ static JSValue* mappedIndexGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot& slot);
- ActivationImp *_activationObject;
+ ActivationImp* _activationObject;
mutable IndexToNameMap indexToNameMap;
};
class ActivationImp : public JSObject {
public:
- ActivationImp(FunctionImp *function, const List &arguments);
+ ActivationImp(FunctionImp* function, const List& arguments);
- virtual bool getOwnPropertySlot(ExecState *exec, const Identifier &, PropertySlot&);
- virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
- virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
+ virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
+ virtual void put(ExecState*, const Identifier& propertyName, JSValue* value, int attr = None);
+ virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
- virtual const ClassInfo *classInfo() const { return &info; }
+ virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
virtual void mark();
bool isActivation() { return true; }
private:
static PropertySlot::GetValueFunc getArgumentsGetter();
- static JSValue *argumentsGetter(ExecState *exec, JSObject *, const Identifier &, const PropertySlot& slot);
- void createArgumentsObject(ExecState *exec) const;
+ static JSValue* argumentsGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot& slot);
+ void createArgumentsObject(ExecState*) const;
- FunctionImp *_function;
+ FunctionImp* _function;
List _arguments;
- mutable Arguments *_argumentsObject;
+ mutable Arguments* _argumentsObject;
};
class GlobalFuncImp : public InternalFunctionImp {
public:
GlobalFuncImp(ExecState*, FunctionPrototype*, int i, int len, const Identifier&);
- virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
+ virtual JSValue* callAsFunction(ExecState*, JSObject* thisObj, const List& args);
virtual CodeType codeType() const;
enum { Eval, ParseInt, ParseFloat, IsNaN, IsFinite, Escape, UnEscape,
DecodeURI, DecodeURIComponent, EncodeURI, EncodeURIComponent
static void init();
Identifier() { }
- Identifier(const char *s) : _ustring(add(s)) { }
- Identifier(const UChar *s, int length) : _ustring(add(s, length)) { }
- explicit Identifier(UString::Rep *rep) : _ustring(add(rep)) { }
- explicit Identifier(const UString &s) : _ustring(add(s.rep())) { }
+ Identifier(const char* s) : _ustring(add(s)) { }
+ Identifier(const UChar* s, int length) : _ustring(add(s, length)) { }
+ explicit Identifier(UString::Rep* rep) : _ustring(add(rep)) { }
+ explicit Identifier(const UString& s) : _ustring(add(s.rep())) { }
- const UString &ustring() const { return _ustring; }
+ const UString& ustring() const { return _ustring; }
DOM::DOMString domString() const;
- const UChar *data() const { return _ustring.data(); }
+ const UChar* data() const { return _ustring.data(); }
int size() const { return _ustring.size(); }
- const char *ascii() const { return _ustring.ascii(); }
+ const char* ascii() const { return _ustring.ascii(); }
static Identifier from(unsigned y) { return Identifier(UString::from(y)); }
bool isNull() const { return _ustring.isNull(); }
bool isEmpty() const { return _ustring.isEmpty(); }
- uint32_t toUInt32(bool *ok) const { return _ustring.toUInt32(ok); }
- uint32_t toStrictUInt32(bool *ok) const { return _ustring.toStrictUInt32(ok); }
- unsigned toArrayIndex(bool *ok) const { return _ustring.toArrayIndex(ok); }
+ uint32_t toUInt32(bool* ok) const { return _ustring.toUInt32(ok); }
+ uint32_t toStrictUInt32(bool* ok) const { return _ustring.toStrictUInt32(ok); }
+ unsigned toArrayIndex(bool* ok) const { return _ustring.toArrayIndex(ok); }
double toDouble() const { return _ustring.toDouble(); }
- static const Identifier &null();
+ static const Identifier& null();
- friend bool operator==(const Identifier &, const Identifier &);
- friend bool operator!=(const Identifier &, const Identifier &);
+ friend bool operator==(const Identifier&, const Identifier&);
+ friend bool operator!=(const Identifier&, const Identifier&);
- friend bool operator==(const Identifier &, const char *);
+ friend bool operator==(const Identifier&, const char*);
- static void remove(UString::Rep *);
+ static void remove(UString::Rep* );
- static bool equal(const UString::Rep *, const char *);
- static bool equal(const UString::Rep *, const UChar *, int length);
- static bool equal(const UString::Rep *, const UString::Rep *);
+ static bool equal(const UString::Rep*, const char*);
+ static bool equal(const UString::Rep*, const UChar*, int length);
+ static bool equal(const UString::Rep*, const UString::Rep*);
private:
UString _ustring;
- static bool equal(const Identifier &a, const Identifier &b)
+ static bool equal(const Identifier& a, const Identifier& b)
{ return a._ustring.rep() == b._ustring.rep(); }
- static bool equal(const Identifier &a, const char *b)
+ static bool equal(const Identifier& a, const char* b)
{ return equal(a._ustring.rep(), b); }
- static PassRefPtr<UString::Rep> add(const char *);
- static PassRefPtr<UString::Rep> add(const UChar *, int length);
- static PassRefPtr<UString::Rep> add(UString::Rep *);
+ static PassRefPtr<UString::Rep> add(const char*);
+ static PassRefPtr<UString::Rep> add(const UChar*, int length);
+ static PassRefPtr<UString::Rep> add(UString::Rep*);
};
#ifndef KJS_IDENTIFIER_HIDE_GLOBALS
extern const Identifier nullIdentifier;
- inline const Identifier &Identifier::null()
+ inline const Identifier& Identifier::null()
{ return nullIdentifier; }
#endif
- inline bool operator==(const Identifier &a, const Identifier &b)
+ inline bool operator==(const Identifier& a, const Identifier& b)
{ return Identifier::equal(a, b); }
- inline bool operator!=(const Identifier &a, const Identifier &b)
+ inline bool operator!=(const Identifier& a, const Identifier& b)
{ return !Identifier::equal(a, b); }
- inline bool operator==(const Identifier &a, const char *b)
+ inline bool operator==(const Identifier& a, const char* b)
{ return Identifier::equal(a, b); }
// List of property names, passed to a macro so we can do set them up various
#define KJS_IDENTIFIER_EACH_PROPERTY_NAME_GLOBAL(macro) \
macro(arguments) \
macro(callee) \
+ macro(caller) \
macro(constructor) \
macro(fromCharCode) \
macro(length) \
Test List: All tests<br>
Skip List: (none)<br>
1135 test(s) selected, 1127 test(s) completed, 73 failures reported (6.47% failed)<br>
-Engine command line: /Users/ap/WebKit/WebKitBuild/Debug/testkjs <br>
-OS type: Darwin host-148-242.himki.net 8.7.0 Darwin Kernel Version 8.7.0: Fri May 26 15:20:53 PDT 2006; root:xnu-792.6.76.obj~1/RELEASE_PPC Power Macintosh powerpc<br>
-Testcase execution time: 7 minutes, 0 seconds.<br>
-Tests completed on Fri Sep 22 13:13:25 2006.<br><br>
+Engine command line: /Users/vlado/WebKit/WebKitBuild/Debug/testkjs <br>
+OS type: Darwin XP-SCK.local 8.8.0 Darwin Kernel Version 8.8.0: Fri Sep 8 17:18:57 PDT 2006; root:xnu-792.12.6.obj~1/RELEASE_PPC Power Macintosh powerpc<br>
+Testcase execution time: 6 minutes, 29 seconds.<br>
+Tests completed on Thu Oct 12 19:11:56 2006.<br><br>
[ <a href='#fail_detail'>Failure Details</a> | <a href='#retest_list'>Retest List</a> | <a href='menu.html'>Test Selection Page</a> ]<br>
<hr>
<a name='fail_detail'></a>
LEAK: 618 KJS::Node<br>
--> RegExp/hex-001.js JS regexp anchoring on empty match bug<br>
--> BUGNUMBER: http://bugzilla.mozilla.org/show_bug.cgi?id=2157<br>
-[15534] ./ecma_2/RegExp/regress-001.js line 18: TypeError: Object /a||b/ (result of expression /a||b/) does not allow calls.<br>
+[11987] ./ecma_2/RegExp/regress-001.js line 18: TypeError: Object /a||b/ (result of expression /a||b/) does not allow calls.<br>
</tt><br>
<a name='failure6'></a><dd><b>Testcase <a target='other_window' href='./ecma_2/RegExp/unicode-001.js'>ecma_2/RegExp/unicode-001.js</a> failed</b> <br>
[ <a href='#failure5'>Previous Failure</a> | <a href='#failure7'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
Complete testcase output was:<br>
LEAK: 671 KJS::Node<br>
--> RegExp/unicode-001.js new RegExp( pattern, flags )<br>
-[15535] ./ecma_2/RegExp/unicode-001.js line 33: TypeError: Null value<br>
+[11988] ./ecma_2/RegExp/unicode-001.js line 33: TypeError: Null value<br>
</tt><br>
<a name='failure7'></a><dd><b>Testcase <a target='other_window' href='./ecma_3/Date/15.9.5.7.js'>ecma_3/Date/15.9.5.7.js</a> failed</b> <br>
[ <a href='#failure6'>Previous Failure</a> | <a href='#failure8'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
<tt><br>
Failure messages were:<br>
---> (Wed Dec 31 1969 16:00:00 GMT-0800 (PST)).toLocaleTimeString() = 4:00:00 PM PST FAILED! expected: 16:00:00<br>
---> (Wed Dec 31 1969 08:00:00 GMT-0800 (PST)).toLocaleTimeString() = 8:00:00 AM PST FAILED! expected: 08:00:00<br>
---> (Sun Dec 31 1899 16:00:00 GMT-0800 (PST)).toLocaleTimeString() = 5:00:00 PM PDT FAILED! expected: 16:00:00<br>
---> (Mon Jan 01 1900 00:00:00 GMT-0800 (PST)).toLocaleTimeString() = 1:00:00 AM PDT FAILED! expected: 00:00:00<br>
---> (Fri Dec 31 1999 16:00:00 GMT-0800 (PST)).toLocaleTimeString() = 4:00:00 PM PST FAILED! expected: 16:00:00<br>
---> (Sat Jan 01 2000 00:00:00 GMT-0800 (PST)).toLocaleTimeString() = 12:00:00 AM PST FAILED! expected: 00:00:00<br>
---> (Mon Feb 28 2000 16:00:00 GMT-0800 (PST)).toLocaleTimeString() = 4:00:00 PM PST FAILED! expected: 16:00:00<br>
---> (Mon Feb 28 2000 15:59:59 GMT-0800 (PST)).toLocaleTimeString() = 3:59:59 PM PST FAILED! expected: 15:59:59<br>
---> (Tue Feb 29 2000 00:00:00 GMT-0800 (PST)).toLocaleTimeString() = 12:00:00 AM PST FAILED! expected: 00:00:00<br>
---> (Fri Sep 22 2006 13:12:12 GMT-0700 (PDT)).toLocaleTimeString() = 1:12:12 PM PDT FAILED! expected: 13:12:12<br>
---> (Fri Sep 22 2006 21:12:12 GMT-0700 (PDT)).toLocaleTimeString() = 9:12:12 PM PDT FAILED! expected: 21:12:12<br>
---> (Fri Dec 31 2004 16:00:00 GMT-0800 (PST)).toLocaleTimeString() = 4:00:00 PM PST FAILED! expected: 16:00:00<br>
---> (Fri Dec 31 2004 15:59:59 GMT-0800 (PST)).toLocaleTimeString() = 3:59:59 PM PST FAILED! expected: 15:59:59<br>
---> (Sat Jan 01 2005 00:00:00 GMT-0800 (PST)).toLocaleTimeString() = 12:00:00 AM PST FAILED! expected: 00:00:00<br>
+--> (Wed Dec 31 1969 19:00:00 GMT-0500 (EST)).toLocaleTimeString() = 7:00:00 PM EST FAILED! expected: 19:00:00<br>
+--> (Wed Dec 31 1969 14:00:00 GMT-0500 (EST)).toLocaleTimeString() = 2:00:00 PM EST FAILED! expected: 14:00:00<br>
+--> (Sun Dec 31 1899 19:00:00 GMT-0500 (EST)).toLocaleTimeString() = 8:00:00 PM EDT FAILED! expected: 19:00:00<br>
+--> (Mon Jan 01 1900 00:00:00 GMT-0500 (EST)).toLocaleTimeString() = 1:00:00 AM EDT FAILED! expected: 00:00:00<br>
+--> (Fri Dec 31 1999 19:00:00 GMT-0500 (EST)).toLocaleTimeString() = 7:00:00 PM EST FAILED! expected: 19:00:00<br>
+--> (Sat Jan 01 2000 00:00:00 GMT-0500 (EST)).toLocaleTimeString() = 12:00:00 AM EST FAILED! expected: 00:00:00<br>
+--> (Mon Feb 28 2000 19:00:00 GMT-0500 (EST)).toLocaleTimeString() = 7:00:00 PM EST FAILED! expected: 19:00:00<br>
+--> (Mon Feb 28 2000 18:59:59 GMT-0500 (EST)).toLocaleTimeString() = 6:59:59 PM EST FAILED! expected: 18:59:59<br>
+--> (Tue Feb 29 2000 00:00:00 GMT-0500 (EST)).toLocaleTimeString() = 12:00:00 AM EST FAILED! expected: 00:00:00<br>
+--> (Thu Oct 12 2006 19:10:40 GMT-0400 (EDT)).toLocaleTimeString() = 7:10:40 PM EDT FAILED! expected: 19:10:40<br>
+--> (Fri Oct 13 2006 00:10:40 GMT-0400 (EDT)).toLocaleTimeString() = 12:10:40 AM EDT FAILED! expected: 00:10:40<br>
+--> (Fri Dec 31 2004 19:00:00 GMT-0500 (EST)).toLocaleTimeString() = 7:00:00 PM EST FAILED! expected: 19:00:00<br>
+--> (Fri Dec 31 2004 18:59:59 GMT-0500 (EST)).toLocaleTimeString() = 6:59:59 PM EST FAILED! expected: 18:59:59<br>
+--> (Sat Jan 01 2005 00:00:00 GMT-0500 (EST)).toLocaleTimeString() = 12:00:00 AM EST FAILED! expected: 00:00:00<br>
</tt><br>
<a name='failure8'></a><dd><b>Testcase <a target='other_window' href='./ecma_3/FunExpr/fe-001.js'>ecma_3/FunExpr/fe-001.js</a> failed</b> <br>
[ <a href='#failure7'>Previous Failure</a> | <a href='#failure9'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
Testcase terminated with signal 0<br>
Complete testcase output was:<br>
LEAK: 397 KJS::Node<br>
-[15688] ./ecma_3/Statements/regress-194364.js line 1: SyntaxError: Parse error<br>
+[12141] ./ecma_3/Statements/regress-194364.js line 1: SyntaxError: Parse error<br>
</tt><br>
<a name='failure20'></a><dd><b>Testcase <a target='other_window' href='./ecma_3/Unicode/uc-001.js'>ecma_3/Unicode/uc-001.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=23610' target='other_window'>Bug Number 23610</a><br>
[ <a href='#failure19'>Previous Failure</a> | <a href='#failure21'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
Complete testcase output was:<br>
LEAK: 403 KJS::Node<br>
--> JS1_2 Object.toString()<br>
-[15709] ./js1_2/Objects/toString-001.js line 103: TypeError: Object /^\{(.*)\}$/ (result of expression /^\{(.*)\}$/) does not allow calls.<br>
+[12162] ./js1_2/Objects/toString-001.js line 103: TypeError: Object /^\{(.*)\}$/ (result of expression /^\{(.*)\}$/) does not allow calls.<br>
</tt><br>
<a name='failure23'></a><dd><b>Testcase <a target='other_window' href='./js1_2/String/concat.js'>js1_2/String/concat.js</a> failed</b> <br>
[ <a href='#failure22'>Previous Failure</a> | <a href='#failure24'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
Complete testcase output was:<br>
LEAK: 333 KJS::Node<br>
--> JS_1.2 The variable statment<br>
-[15722] ./js1_2/function/regexparg-1.js line 80: TypeError: Object /abc/ (result of expression x) does not allow calls.<br>
+[12175] ./js1_2/function/regexparg-1.js line 80: TypeError: Object /abc/ (result of expression x) does not allow calls.<br>
</tt><br>
<a name='failure29'></a><dd><b>Testcase <a target='other_window' href='./js1_2/function/tostring-1.js'>js1_2/function/tostring-1.js</a> failed</b> <br>
[ <a href='#failure28'>Previous Failure</a> | <a href='#failure30'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
LEAK: 329 KJS::Node<br>
--> Executing script: compile.js<br>
--> As described in Netscape doc "Whats new in JavaScript 1.2" RegExp: compile<br>
-[15749] ./js1_2/regexp/compile.js line 43: TypeError: Value undefined (result of expression regularExpression.compile) is not object.<br>
+[12202] ./js1_2/regexp/compile.js line 43: TypeError: Value undefined (result of expression regularExpression.compile) is not object.<br>
</tt><br>
<a name='failure37'></a><dd><b>Testcase <a target='other_window' href='./js1_2/regexp/endLine.js'>js1_2/regexp/endLine.js</a> failed</b> <br>
[ <a href='#failure36'>Previous Failure</a> | <a href='#failure38'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
Complete testcase output was:<br>
LEAK: 329 KJS::Node<br>
--> BUGNUMBER: http://bugzilla.mozilla.org/show_bug.cgi?id=6359<br>
-[15765] ./js1_2/regexp/regress-6359.js line 56: TypeError: Object /(a*)b\1+/ (result of expression /(a*)b\1+/) does not allow calls.<br>
+[12218] ./js1_2/regexp/regress-6359.js line 56: TypeError: Object /(a*)b\1+/ (result of expression /(a*)b\1+/) does not allow calls.<br>
</tt><br>
<a name='failure39'></a><dd><b>Testcase <a target='other_window' href='./js1_2/regexp/regress-9141.js'>js1_2/regexp/regress-9141.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=http://bugzilla.mozilla.org/show_bug.cgi?id=9141' target='other_window'>Bug Number http://bugzilla.mozilla.org/show_bug.cgi?id=9141</a><br>
[ <a href='#failure38'>Previous Failure</a> | <a href='#failure40'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
Complete testcase output was:<br>
LEAK: 329 KJS::Node<br>
--> BUGNUMBER: http://bugzilla.mozilla.org/show_bug.cgi?id=9141<br>
-[15766] ./js1_2/regexp/regress-9141.js line 73: TypeError: Object /(?:xx|x)*/ (result of expression /(?:xx|x)*/) does not allow calls.<br>
+[12219] ./js1_2/regexp/regress-9141.js line 73: TypeError: Object /(?:xx|x)*/ (result of expression /(?:xx|x)*/) does not allow calls.<br>
</tt><br>
<a name='failure40'></a><dd><b>Testcase <a target='other_window' href='./js1_2/regexp/simple_form.js'>js1_2/regexp/simple_form.js</a> failed</b> <br>
[ <a href='#failure39'>Previous Failure</a> | <a href='#failure41'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
LEAK: 329 KJS::Node<br>
--> Executing script: simple_form.js<br>
--> As described in Netscape doc "Whats new in JavaScript 1.2" RegExp: simple form<br>
-[15767] ./js1_2/regexp/simple_form.js line 43: TypeError: Object /[0-9]{3}/ (result of expression /[0-9]{3}/) does not allow calls.<br>
+[12220] ./js1_2/regexp/simple_form.js line 43: TypeError: Object /[0-9]{3}/ (result of expression /[0-9]{3}/) does not allow calls.<br>
</tt><br>
<a name='failure41'></a><dd><b>Testcase <a target='other_window' href='./js1_2/regexp/special_characters.js'>js1_2/regexp/special_characters.js</a> failed</b> <br>
[ <a href='#failure40'>Previous Failure</a> | <a href='#failure42'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
Complete testcase output was:<br>
LEAK: 389 KJS::Node<br>
--> script-001 NativeScript<br>
-[15793] ./js1_3/Script/script-001.js line 133: ReferenceError: Can't find variable: Script<br>
+[12246] ./js1_3/Script/script-001.js line 133: ReferenceError: Can't find variable: Script<br>
</tt><br>
<a name='failure47'></a><dd><b>Testcase <a target='other_window' href='./js1_3/regress/function-001-n.js'>js1_3/regress/function-001-n.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=10278' target='other_window'>Bug Number 10278</a><br>
[ <a href='#failure46'>Previous Failure</a> | <a href='#failure48'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
Testcase terminated with signal 0<br>
Complete testcase output was:<br>
LEAK: 473 KJS::Node<br>
-[15838] ./js1_5/Exceptions/errstack-001.js line 247: TypeError: Undefined value<br>
+[12291] ./js1_5/Exceptions/errstack-001.js line 247: TypeError: Undefined value<br>
</tt><br>
<a name='failure52'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Exceptions/regress-50447.js'>js1_5/Exceptions/regress-50447.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=50447' target='other_window'>Bug Number 50447</a><br>
[ <a href='#failure51'>Previous Failure</a> | <a href='#failure53'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
LEAK: 654 KJS::Node<br>
--> BUGNUMBER: 50447<br>
--> STATUS: Test (non-ECMA) Error object properties fileName, lineNumber<br>
-[15839] ./js1_5/Exceptions/regress-50447.js line 65: TypeError: Undefined value<br>
+[12292] ./js1_5/Exceptions/regress-50447.js line 65: TypeError: Undefined value<br>
</tt><br>
<a name='failure53'></a><dd><b>Testcase <a target='other_window' href='./js1_5/GetSet/getset-001.js'>js1_5/GetSet/getset-001.js</a> failed</b> <br>
[ <a href='#failure52'>Previous Failure</a> | <a href='#failure54'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
Testcase terminated with signal 0<br>
Complete testcase output was:<br>
LEAK: 765 KJS::Node<br>
-[15854] ./js1_5/Object/regress-90596-001.js line 48: TypeError: Value undefined (result of expression obj.toSource) is not object.<br>
+[12307] ./js1_5/Object/regress-90596-001.js line 48: TypeError: Value undefined (result of expression obj.toSource) is not object.<br>
</tt><br>
<a name='failure57'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Object/regress-90596-002.js'>js1_5/Object/regress-90596-002.js</a> failed</b> <br>
[ <a href='#failure56'>Previous Failure</a> | <a href='#failure58'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
Testcase terminated with signal 0<br>
Complete testcase output was:<br>
LEAK: 769 KJS::Node<br>
-[15855] ./js1_5/Object/regress-90596-002.js line 48: ReferenceError: Can't find variable: uneval<br>
+[12308] ./js1_5/Object/regress-90596-002.js line 48: ReferenceError: Can't find variable: uneval<br>
</tt><br>
<a name='failure58'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Object/regress-96284-001.js'>js1_5/Object/regress-96284-001.js</a> failed</b> <br>
[ <a href='#failure57'>Previous Failure</a> | <a href='#failure59'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
Testcase terminated with signal 0<br>
Complete testcase output was:<br>
LEAK: 397 KJS::Node<br>
-[15857] ./js1_5/Object/regress-96284-001.js line 49: TypeError: Value undefined (result of expression obj1.toSource) is not object.<br>
+[12310] ./js1_5/Object/regress-96284-001.js line 49: TypeError: Value undefined (result of expression obj1.toSource) is not object.<br>
</tt><br>
<a name='failure59'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Object/regress-96284-002.js'>js1_5/Object/regress-96284-002.js</a> failed</b> <br>
[ <a href='#failure58'>Previous Failure</a> | <a href='#failure60'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
Testcase terminated with signal 0<br>
Complete testcase output was:<br>
LEAK: 397 KJS::Node<br>
-[15858] ./js1_5/Object/regress-96284-002.js line 49: ReferenceError: Can't find variable: uneval<br>
+[12311] ./js1_5/Object/regress-96284-002.js line 49: ReferenceError: Can't find variable: uneval<br>
</tt><br>
<a name='failure60'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Regress/regress-44009.js'>js1_5/Regress/regress-44009.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=44009' target='other_window'>Bug Number 44009</a><br>
[ <a href='#failure59'>Previous Failure</a> | <a href='#failure61'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
LEAK: 396 KJS::Node<br>
--> BUGNUMBER: 44009<br>
--> STATUS: Testing that we don't crash on obj.toSource()<br>
-[15863] ./js1_5/Regress/regress-44009.js line 60: TypeError: Value undefined (result of expression obj.toSource) is not object.<br>
+[12316] ./js1_5/Regress/regress-44009.js line 60: TypeError: Value undefined (result of expression obj.toSource) is not object.<br>
</tt><br>
<a name='failure61'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Regress/regress-68498-003.js'>js1_5/Regress/regress-68498-003.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=68498' target='other_window'>Bug Number 68498</a><br>
[ <a href='#failure60'>Previous Failure</a> | <a href='#failure62'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
Testcase terminated with signal 0<br>
Complete testcase output was:<br>
LEAK: 419 KJS::Node<br>
-[15889] ./js1_5/Regress/regress-127557.js line 75: ReferenceError: Can't find variable: clone<br>
+[12342] ./js1_5/Regress/regress-127557.js line 75: ReferenceError: Can't find variable: clone<br>
</tt><br>
<a name='failure65'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Regress/regress-172699.js'>js1_5/Regress/regress-172699.js</a> failed</b> <br>
[ <a href='#failure64'>Previous Failure</a> | <a href='#failure66'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
Testcase terminated with signal 0<br>
Complete testcase output was:<br>
LEAK: 397 KJS::Node<br>
-[15898] ./js1_5/Regress/regress-172699.js line 61: URIError: URI error<br>
+[12353] ./js1_5/Regress/regress-172699.js line 61: URIError: URI error<br>
</tt><br>
<a name='failure66'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Regress/regress-179524.js'>js1_5/Regress/regress-179524.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=179524' target='other_window'>Bug Number 179524</a><br>
[ <a href='#failure65'>Previous Failure</a> | <a href='#failure67'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
Testcase terminated with signal 0<br>
Complete testcase output was:<br>
LEAK: 397 KJS::Node<br>
-[15923] ./js1_5/Scope/regress-220584.js line 56: ReferenceError: Can't find variable: Script<br>
+[12378] ./js1_5/Scope/regress-220584.js line 56: ReferenceError: Can't find variable: Script<br>
</tt><br>
<a name='failure69'></a><dd><b>Testcase <a target='other_window' href='./js1_5/Scope/scope-001.js'>js1_5/Scope/scope-001.js</a> failed</b> <a href='http://bugzilla.mozilla.org/show_bug.cgi?id=53268' target='other_window'>Bug Number 53268</a><br>
[ <a href='#failure68'>Previous Failure</a> | <a href='#failure70'>Next Failure</a> | <a href='#tippy_top'>Top of Page</a> ]<br>
--> BUGNUMBER: 306591<br>
--> STATUS: String static methods<br>
--> STATUS: See https://bugzilla.mozilla.org/show_bug.cgi?id=304828<br>
-[15945] ./js1_6/String/regress-306591.js line 48: TypeError: Value undefined (result of expression String.split) is not object.<br>
+[12400] ./js1_6/String/regress-306591.js line 48: TypeError: Value undefined (result of expression String.split) is not object.<br>
</tt><br>
</dl>
[ <a href='#tippy_top'>Top of Page</a> | <a href='#fail_detail'>Top of Failures</a> ]<br>
<pre>
<a name='retest_list'></a>
<h2>Retest List</h2><br>
-# Retest List, kjs, generated Fri Sep 22 13:13:25 2006.
+# Retest List, kjs, generated Thu Oct 12 19:11:56 2006.
# Original test base was: All tests.
# 1127 of 1135 test(s) were completed, 73 failures reported.
ecma/GlobalObject/15.1.2.2-2.js
+2006-10-31 Vladimir Olexa <vladimir.olexa@gmail.com>
+
+ Reviewed by Geoff.
+
+ Test for http://bugs.webkit.org/show_bug.cgi?id=4166
+ Function object does not support caller property
+
+ * fast/js/caller-property-expected.txt: Added.
+ * fast/js/caller-property.html: Added.
+ * fast/js/resources/caller-property.js: Added.
+
2006-10-30 Darin Adler <darin@apple.com>
Requested by Maciej.
--- /dev/null
+This tests for caller property in functions. Only functions that are called from inside of other functions and have a parent should have this property set. Tests return true when caller is found and false when the caller is null.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS childHasCallerWhenExecutingGlobalCode is false
+PASS childHasCallerWhenCalledWithoutParent is false
+PASS childHasCallerWhenCalledFromWithinParent is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="resources/js-test-style.css">
+<script src="resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/caller-property.js"></script>
+<script src="resources/js-test-post.js"></script>
+</body>
+</html>
--- /dev/null
+description(
+'This tests for caller property in functions. Only functions that are called from inside of other functions and have a parent should have this property set. Tests return true when caller is found and false when the caller is null.'
+)
+function child()
+{
+ return (child.caller !== null);
+}
+
+function parent()
+{
+ return child();
+}
+
+var childHasCallerWhenExecutingGlobalCode = (child.caller !== null);
+var childHasCallerWhenCalledWithoutParent = child();
+var childHasCallerWhenCalledFromWithinParent = parent();
+
+shouldBe('childHasCallerWhenExecutingGlobalCode', 'false');
+shouldBe('childHasCallerWhenCalledWithoutParent', 'false');
+shouldBe('childHasCallerWhenCalledFromWithinParent', 'true')
+
+var successfullyParsed = true;