Changeset 34580 in webkit for trunk/JavaScriptCore/kjs/date_object.cpp
- Timestamp:
- Jun 15, 2008, 8:02:57 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/date_object.cpp
r33979 r34580 83 83 * Date object 84 84 */ 85 class Date ObjectFuncImp : public InternalFunctionImp{85 class DateFunction : public InternalFunction { 86 86 public: 87 Date ObjectFuncImp(ExecState *, FunctionPrototype *, int i, int len, const Identifier& );87 DateFunction(ExecState *, FunctionPrototype *, int i, int len, const Identifier& ); 88 88 89 89 virtual JSValue *callAsFunction(ExecState *, JSObject *thisObj, const List &args); … … 474 474 { 475 475 setInternalValue(jsNaN()); 476 // The constructor will be added later, after Date ObjectImphas been built.476 // The constructor will be added later, after DateConstructor has been built. 477 477 } 478 478 … … 482 482 } 483 483 484 // ------------------------------ Date ObjectImp--------------------------------484 // ------------------------------ DateConstructor -------------------------------- 485 485 486 486 // TODO: MakeTime (15.9.11.1) etc. ? 487 487 488 Date ObjectImp::DateObjectImp(ExecState* exec, FunctionPrototype* funcProto, DatePrototype* dateProto)489 : InternalFunction Imp(funcProto, dateProto->classInfo()->className)488 DateConstructor::DateConstructor(ExecState* exec, FunctionPrototype* funcProto, DatePrototype* dateProto) 489 : InternalFunction(funcProto, dateProto->classInfo()->className) 490 490 { 491 491 putDirect(exec->propertyNames().prototype, dateProto, DontEnum|DontDelete|ReadOnly); 492 putDirectFunction(new Date ObjectFuncImp(exec, funcProto, DateObjectFuncImp::Parse, 1, exec->propertyNames().parse), DontEnum);493 putDirectFunction(new Date ObjectFuncImp(exec, funcProto, DateObjectFuncImp::UTC, 7, exec->propertyNames().UTC), DontEnum);494 putDirectFunction(new Date ObjectFuncImp(exec, funcProto, DateObjectFuncImp::Now, 0, exec->propertyNames().now), DontEnum);492 putDirectFunction(new DateFunction(exec, funcProto, DateFunction::Parse, 1, exec->propertyNames().parse), DontEnum); 493 putDirectFunction(new DateFunction(exec, funcProto, DateFunction::UTC, 7, exec->propertyNames().UTC), DontEnum); 494 putDirectFunction(new DateFunction(exec, funcProto, DateFunction::Now, 0, exec->propertyNames().now), DontEnum); 495 495 putDirect(exec->propertyNames().length, 7, ReadOnly|DontDelete|DontEnum); 496 496 } 497 497 498 ConstructType Date ObjectImp::getConstructData(ConstructData&)498 ConstructType DateConstructor::getConstructData(ConstructData&) 499 499 { 500 500 return ConstructTypeNative; … … 502 502 503 503 // ECMA 15.9.3 504 JSObject *Date ObjectImp::construct(ExecState *exec, const List &args)504 JSObject *DateConstructor::construct(ExecState *exec, const List &args) 505 505 { 506 506 int numArgs = args.size(); … … 550 550 551 551 // ECMA 15.9.2 552 JSValue *Date ObjectImp::callAsFunction(ExecState * /*exec*/, JSObject * /*thisObj*/, const List &/*args*/)552 JSValue *DateConstructor::callAsFunction(ExecState * /*exec*/, JSObject * /*thisObj*/, const List &/*args*/) 553 553 { 554 554 time_t localTime = time(0); … … 559 559 } 560 560 561 // ------------------------------ Date ObjectFuncImp----------------------------562 563 Date ObjectFuncImp::DateObjectFuncImp(ExecState* exec, FunctionPrototype* funcProto, int i, int len, const Identifier& name)564 : InternalFunction Imp(funcProto, name), id(i)561 // ------------------------------ DateFunction ---------------------------- 562 563 DateFunction::DateFunction(ExecState* exec, FunctionPrototype* funcProto, int i, int len, const Identifier& name) 564 : InternalFunction(funcProto, name), id(i) 565 565 { 566 566 putDirect(exec->propertyNames().length, len, DontDelete|ReadOnly|DontEnum); … … 568 568 569 569 // ECMA 15.9.4.2 - 3 570 JSValue *Date ObjectFuncImp::callAsFunction(ExecState* exec, JSObject*, const List& args)570 JSValue *DateFunction::callAsFunction(ExecState* exec, JSObject*, const List& args) 571 571 { 572 572 if (id == Parse)
Note:
See TracChangeset
for help on using the changeset viewer.