JavaScriptCore:

        Reviewed by Oliver.

        - fix http://bugs.webkit.org/show_bug.cgi?id=16498
          ''.constructor.toString() gives [function]

        Test: fast/js/function-names.html

        * kjs/array_object.cpp:
        (KJS::ArrayObjectImp::ArrayObjectImp): Use the class name as the constructor's function name.
        * kjs/bool_object.cpp:
        (KJS::BooleanObjectImp::BooleanObjectImp): Ditto.
        * kjs/date_object.cpp:
        (KJS::DateObjectImp::DateObjectImp): Ditto.
        * kjs/error_object.cpp:
        (KJS::ErrorPrototype::ErrorPrototype): Make the error object be an Error.
        (KJS::ErrorObjectImp::ErrorObjectImp): Use the class name as the constructor's function name.
        (KJS::NativeErrorPrototype::NativeErrorPrototype): Take const UString&.
        (KJS::NativeErrorImp::NativeErrorImp): Use the prototype's name as the constructor's function
        name.
        * kjs/error_object.h: Change ErrorPrototype to inherit from ErrorInstance. Change the
        NativeErrorImp constructor to take a NativeErrorPrototype pointer for its prototype.
        * kjs/function.h: Removed unneeded constructor for internal functions without names.
        We want to avoid those!
        * kjs/function_object.cpp:
        (KJS::functionProtoFuncToString): Removed code that writes out just [function] for functions
        that have no names. There's no reason to do that.
        (KJS::FunctionObjectImp::FunctionObjectImp): Use the class name as the constructor's
        function name.
        * kjs/internal.cpp: Removed the unused constructor.
        * kjs/number_object.cpp:
        (KJS::fractionalPartToString): Marked static for internal linkage.
        (KJS::exponentialPartToString): Ditto.
        (KJS::numberProtoFuncToPrecision): Removed an unneeded else.
        (KJS::NumberObjectImp::NumberObjectImp): Use the class name as the constructor's
        function name.
        (KJS::NumberObjectImp::getValueProperty): Tweaked formatting.
        * kjs/object_object.cpp:
        (KJS::ObjectObjectImp::ObjectObjectImp): Use "Object" for the function name.
        * kjs/regexp_object.cpp:
        (KJS::RegExpObjectImp::RegExpObjectImp): Use "RegExp" for the function name.
        * kjs/string_object.cpp:
        (KJS::StringObjectImp::StringObjectImp): Use the class name as the constructor's
        function name.

LayoutTests:

        Reviewed by Oliver.

        - test for http://bugs.webkit.org/show_bug.cgi?id=16498
          ''.constructor.toString() gives [function]

        * fast/js/function-names-expected.txt: Updated for new tests.
        * fast/js/kde/resources/function.js: Updated test to expect the format that Gecko uses
        for native code, which we now match character for character.
        * fast/js/resources/function-names.js: Added tests for the names of all the constructors.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/kjs/string_object.cpp b/JavaScriptCore/kjs/string_object.cpp
index 43c245e..3478f5e 100644
--- a/JavaScriptCore/kjs/string_object.cpp
+++ b/JavaScriptCore/kjs/string_object.cpp
@@ -1,7 +1,7 @@
 // -*- c-basic-offset: 2 -*-
 /*
  *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
- *  Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
+ *  Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
@@ -987,10 +987,8 @@
 
 // ------------------------------ StringObjectImp ------------------------------
 
-StringObjectImp::StringObjectImp(ExecState* exec,
-                                 FunctionPrototype* funcProto,
-                                 StringPrototype* stringProto)
-  : InternalFunctionImp(funcProto)
+StringObjectImp::StringObjectImp(ExecState* exec, FunctionPrototype* funcProto, StringPrototype* stringProto)
+  : InternalFunctionImp(funcProto, stringProto->classInfo()->className)
 {
   // ECMA 15.5.3.1 String.prototype
   putDirect(exec->propertyNames().prototype, stringProto, DontEnum|DontDelete|ReadOnly);