Ignore:
Timestamp:
Mar 23, 2006, 10:28:07 PM (19 years ago)
Author:
darin
Message:

JavaScriptCore:

Reviewed by Maciej.

  • kjs/object.h: Take function name, as well as source URL and line number, when using the special overloaded construct for making functions.
  • kjs/object.cpp: (KJS::JSObject::construct): Ditto.
  • kjs/function_object.h: Ditto.
  • kjs/function_object.cpp: (FunctionObjectImp::construct): Pass a name when constructing the function rather than null. Use "anonymous" when making a function using the default function constructor.
  • kjs/nodes2string.cpp: (FuncDeclNode::streamTo): Put a line break just before a function declaration.
  • unrelated fix
  • kxmlcore/HashMapPtrSpec.h: Add missing needed friend declaration.

LayoutTests:

  • fast/js/resources/function-names.js: Added.
  • fast/js/function-names.html: Generated.
  • fast/js/function-names-expected.txt: Generated.

WebCore:

Reviewed by Maciej.

Test: fast/js/function-names.html

  • dom/Document.h: Add function name parameter to createHTMLEventListener.
  • dom/Document.cpp: (WebCore::Document::createHTMLEventListener): Pass function name when calling createHTMLEventHandler. (WebCore::Document::setHTMLWindowEventListener): Pass attribute name as function name when calling createHTMLEventListener.
  • html/HTMLElement.cpp: (WebCore::HTMLElement::setHTMLEventListener): Pass attribute name as function name when calling createHTMLEventListener.
  • khtml/ecma/kjs_events.h: Add a function name parameter to JSLazyEventListener.
  • khtml/ecma/kjs_events.cpp: (KJS::JSLazyEventListener::JSLazyEventListener): Take and store a function name. (KJS::JSLazyEventListener::parseCode): Pass function name when constructing the function.
  • khtml/ecma/kjs_proxy.h: Add a function name parameter to createHTMLEventHandler and createSVGEventHandler.
  • khtml/ecma/kjs_proxy.cpp: (WebCore::KJSProxy::createHTMLEventHandler): Pass function name when creating a JSLazyEventListener. (WebCore::KJSProxy::createSVGEventHandler): Ditto.
  • ksvg2/events/JSSVGLazyEventListener.h: Add a function name parameter to JSSVGLazyEventListener.
  • ksvg2/events/JSSVGLazyEventListener.cpp: (WebCore::JSSVGLazyEventListener::JSSVGLazyEventListener): Pass the function name on to the base class constructor.
  • ksvg2/misc/SVGDocumentExtensions.h: Add function name parameter to createSVGEventListener.
  • ksvg2/misc/SVGDocumentExtensions.cpp: (WebCore::SVGDocumentExtensions::createSVGEventListener): Pass function name when calling createSVGEventHandler.
  • ksvg2/svg/SVGElement.cpp: (WebCore::SVGElement::addSVGEventListener):
  • ksvg2/svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::addSVGWindowEventListner): Pass attribute name as function name when calling createSVGEventListener.
  • WebCore.xcodeproj/project.pbxproj: Moved generation script to the top.
File:
1 edited

Legend:

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

    r13015 r13465  
    33 *  This file is part of the KDE libraries
    44 *  Copyright (C) 1999-2001 Harri Porten ([email protected])
    5  *  Copyright (C) 2003 Apple Computer, Inc.
     5 *  Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
    66 *
    77 *  This library is free software; you can redistribute it and/or
     
    165165
    166166// ECMA 15.3.2 The Function Constructor
    167 JSObject *FunctionObjectImp::construct(ExecState *exec, const List &args, const UString &sourceURL, int lineNumber)
     167JSObject* FunctionObjectImp::construct(ExecState* exec, const List& args, const Identifier& functionName, const UString& sourceURL, int lineNumber)
    168168{
    169169  UString p("");
     
    208208  FunctionBodyNode *bodyNode = progNode.get();
    209209
    210   FunctionImp *fimp = new DeclaredFunctionImp(exec, Identifier::null(), bodyNode, scopeChain);
     210  FunctionImp* fimp = new DeclaredFunctionImp(exec, functionName, bodyNode, scopeChain);
    211211 
    212212  // parse parameter list. throw syntax error on illegal identifiers
     
    251251
    252252// ECMA 15.3.2 The Function Constructor
    253 JSObject *FunctionObjectImp::construct(ExecState *exec, const List &args)
    254 {
    255   return FunctionObjectImp::construct(exec, args, UString(), 0);
     253JSObject* FunctionObjectImp::construct(ExecState* exec, const List& args)
     254{
     255  return construct(exec, args, "anonymous", UString(), 0);
    256256}
    257257
    258258// ECMA 15.3.1 The Function Constructor Called as a Function
    259 JSValue *FunctionObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
    260 {
    261   return construct(exec,args);
    262 }
     259JSValue* FunctionObjectImp::callAsFunction(ExecState* exec, JSObject* /*thisObj*/, const List &args)
     260{
     261  return construct(exec, args);
     262}
Note: See TracChangeset for help on using the changeset viewer.