Changeset 2783 in webkit for trunk/JavaScriptCore/kjs/function_object.cpp
- Timestamp:
- Nov 20, 2002, 1:12:14 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/function_object.cpp
r2778 r2783 41 41 { 42 42 Value protect(this); 43 put(exec, toStringPropertyName, Object(new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::ToString, 0)), DontEnum); 44 put(exec, "apply", Object(new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::Apply, 2)), DontEnum); 45 put(exec, "call", Object(new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::Call, 1)), DontEnum); 43 putDirect(toStringPropertyName, new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::ToString, 0), DontEnum); 44 static const Identifier applyPropertyName("apply"); 45 putDirect(applyPropertyName, new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::Apply, 2), DontEnum); 46 static const Identifier callPropertyName("call"); 47 putDirect(callPropertyName, new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::Call, 1), DontEnum); 46 48 } 47 49 … … 68 70 { 69 71 Value protect(this); 70 put (exec,lengthPropertyName,Number(len),DontDelete|ReadOnly|DontEnum);72 putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum); 71 73 } 72 74 … … 175 177 { 176 178 Value protect(this); 177 put (exec,prototypePropertyName, Object(funcProto), DontEnum|DontDelete|ReadOnly);179 putDirect(prototypePropertyName, funcProto, DontEnum|DontDelete|ReadOnly); 178 180 179 181 // no. of arguments for constructor 180 put (exec,lengthPropertyName, Number(1), ReadOnly|DontDelete|DontEnum);182 putDirect(lengthPropertyName, NumberImp::one(), ReadOnly|DontDelete|DontEnum); 181 183 } 182 184 … … 276 278 } 277 279 278 fimp->put(exec,lengthPropertyName, Number(params),ReadOnly|DontDelete|DontEnum);279 280 List consArgs; 280 281 281 282 Object objCons = exec->interpreter()->builtinObject(); 282 283 Object prototype = objCons.construct(exec,List::empty()); 283 prototype.put(exec, constructorPropertyName, 284 Object(fimp), DontEnum|DontDelete|ReadOnly); 285 fimp->put(exec,prototypePropertyName,prototype,DontEnum|DontDelete|ReadOnly); 284 prototype.put(exec, constructorPropertyName, Value(fimp), DontEnum|DontDelete|ReadOnly); 285 fimp->put(exec, prototypePropertyName, prototype, DontEnum|DontDelete|ReadOnly); 286 286 return ret; 287 287 }
Note:
See TracChangeset
for help on using the changeset viewer.