Ignore:
Timestamp:
Jan 27, 2008, 12:54:25 AM (17 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

Reviewed by Oliver.

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.

  • 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/internal.cpp

    r28468 r29817  
    22 *  Copyright (C) 1999-2002 Harri Porten ([email protected])
    33 *  Copyright (C) 2001 Peter Kelly ([email protected])
    4  *  Copyright (C) 2004, 2007 Apple Inc. All rights reserved.
     4 *  Copyright (C) 2004, 2007, 2008 Apple Inc. All rights reserved.
    55 *
    66 *  This library is free software; you can redistribute it and/or
     
    227227}
    228228
    229 InternalFunctionImp::InternalFunctionImp(FunctionPrototype* funcProto)
    230   : JSObject(funcProto)
    231 {
    232 }
    233 
    234229InternalFunctionImp::InternalFunctionImp(FunctionPrototype* funcProto, const Identifier& name)
    235230  : JSObject(funcProto)
Note: See TracChangeset for help on using the changeset viewer.