Changeset 32807 in webkit for trunk/JavaScriptCore/kjs/function_object.cpp
- Timestamp:
- May 2, 2008, 3:07:53 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/function_object.cpp
r32652 r32807 45 45 FunctionPrototype::FunctionPrototype(ExecState* exec) 46 46 { 47 putDirect(exec->propertyNames().length, jsNumber( 0), DontDelete | ReadOnly | DontEnum);48 49 putDirectFunction(new PrototypeFunction(exec, this, 0, exec->propertyNames().toString, functionProtoFuncToString), DontEnum);50 putDirectFunction(new PrototypeFunction(exec, this, 2, exec->propertyNames().apply, functionProtoFuncApply), DontEnum);51 putDirectFunction(new PrototypeFunction(exec, this, 1, exec->propertyNames().call, functionProtoFuncCall), DontEnum);47 putDirect(exec->propertyNames().length, jsNumber(exec, 0), DontDelete | ReadOnly | DontEnum); 48 49 putDirectFunction(new (exec) PrototypeFunction(exec, this, 0, exec->propertyNames().toString, functionProtoFuncToString), DontEnum); 50 putDirectFunction(new (exec) PrototypeFunction(exec, this, 2, exec->propertyNames().apply, functionProtoFuncApply), DontEnum); 51 putDirectFunction(new (exec) PrototypeFunction(exec, this, 1, exec->propertyNames().call, functionProtoFuncCall), DontEnum); 52 52 } 53 53 … … 71 71 if (thisObj->inherits(&FunctionImp::info)) { 72 72 FunctionImp* fi = static_cast<FunctionImp*>(thisObj); 73 return jsString( "function " + fi->functionName().ustring() + "(" + fi->body->paramString() + ") " + fi->body->toString());74 } 75 76 return jsString( "function " + static_cast<InternalFunctionImp*>(thisObj)->functionName().ustring() + "() {\n [native code]\n}");73 return jsString(exec, "function " + fi->functionName().ustring() + "(" + fi->body->paramString() + ") " + fi->body->toString()); 74 } 75 76 return jsString(exec, "function " + static_cast<InternalFunctionImp*>(thisObj)->functionName().ustring() + "() {\n [native code]\n}"); 77 77 } 78 78 … … 134 134 135 135 // Number of arguments for constructor 136 putDirect(exec->propertyNames().length, jsNumber( 1), ReadOnly | DontDelete | DontEnum);136 putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontDelete | DontEnum); 137 137 } 138 138 … … 169 169 Debugger* dbg = exec->dynamicGlobalObject()->debugger(); 170 170 if (dbg && !dbg->sourceParsed(exec, sourceId, UString(), body, lineNumber, errLine, errMsg)) 171 return new JSObject();171 return new (exec) JSObject(); 172 172 173 173 // No program node == syntax error - throw a syntax error … … 180 180 scopeChain.push(exec->lexicalGlobalObject()); 181 181 182 FunctionImp* fimp = new FunctionImp(exec, functionName, functionBody.get(), scopeChain);182 FunctionImp* fimp = new (exec) FunctionImp(exec, functionName, functionBody.get(), scopeChain); 183 183 184 184 // parse parameter list. throw syntax error on illegal identifiers
Note:
See TracChangeset
for help on using the changeset viewer.