Changeset 2783 in webkit for trunk/JavaScriptCore/kjs/date_object.cpp
- Timestamp:
- Nov 20, 2002, 1:12:14 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/date_object.cpp
r2760 r2783 210 210 const ClassInfo DateInstanceImp::info = {"Date", 0, 0, 0}; 211 211 212 DateInstanceImp::DateInstanceImp( const Object &proto)212 DateInstanceImp::DateInstanceImp(ObjectImp *proto) 213 213 : ObjectImp(proto) 214 214 { … … 272 272 DatePrototypeImp::DatePrototypeImp(ExecState *, 273 273 ObjectPrototypeImp *objectProto) 274 : DateInstanceImp( Object(objectProto))274 : DateInstanceImp(objectProto) 275 275 { 276 276 Value protect(this); 277 setInternalValue(Number (NaN));277 setInternalValue(NumberImp::create(NaN)); 278 278 // The constructor will be added later, after DateObjectImp has been built 279 279 } … … 293 293 { 294 294 Value protect(this); 295 put (exec,lengthPropertyName,Number(len),DontDelete|ReadOnly|DontEnum);295 putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum); 296 296 } 297 297 … … 524 524 { 525 525 Value protect(this); 526 526 527 // ECMA 15.9.4.1 Date.prototype 527 put(exec,prototypePropertyName, Object(dateProto), DontEnum|DontDelete|ReadOnly); 528 529 put(exec,"parse", Object(new DateObjectFuncImp(exec,funcProto,DateObjectFuncImp::Parse, 1)), DontEnum); 530 put(exec,"UTC", Object(new DateObjectFuncImp(exec,funcProto,DateObjectFuncImp::UTC, 7)), DontEnum); 528 putDirect(prototypePropertyName, dateProto, DontEnum|DontDelete|ReadOnly); 529 530 static const Identifier parsePropertyName("parse"); 531 putDirect(parsePropertyName, new DateObjectFuncImp(exec,funcProto,DateObjectFuncImp::Parse, 1), DontEnum); 532 static const Identifier UTCPropertyName("UTC"); 533 putDirect("UTC", new DateObjectFuncImp(exec,funcProto,DateObjectFuncImp::UTC, 7), DontEnum); 531 534 532 535 // no. of arguments for constructor 533 put (exec,lengthPropertyName, Number(7), ReadOnly|DontDelete|DontEnum);536 putDirect(lengthPropertyName, 7, ReadOnly|DontDelete|DontEnum); 534 537 } 535 538 … … 602 605 603 606 Object proto = exec->interpreter()->builtinDatePrototype(); 604 Object ret(new DateInstanceImp(proto ));607 Object ret(new DateInstanceImp(proto.imp())); 605 608 ret.setInternalValue(timeClip(value)); 606 609 return ret; … … 637 640 { 638 641 Value protect(this); 639 put (exec,lengthPropertyName,Number(len),DontDelete|ReadOnly|DontEnum);642 putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum); 640 643 } 641 644
Note:
See TracChangeset
for help on using the changeset viewer.