Changeset 33422 in webkit for trunk/JavaScriptCore/kjs/date_object.cpp
- Timestamp:
- May 13, 2008, 5:38:21 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/date_object.cpp
r33038 r33422 89 89 virtual JSValue *callAsFunction(ExecState *, JSObject *thisObj, const List &args); 90 90 91 enum { Parse, UTC };91 enum { Parse, UTC, Now }; 92 92 93 93 private: … … 492 492 putDirectFunction(new DateObjectFuncImp(exec, funcProto, DateObjectFuncImp::Parse, 1, exec->propertyNames().parse), DontEnum); 493 493 putDirectFunction(new DateObjectFuncImp(exec, funcProto, DateObjectFuncImp::UTC, 7, exec->propertyNames().UTC), DontEnum); 494 putDirectFunction(new DateObjectFuncImp(exec, funcProto, DateObjectFuncImp::Now, 0, exec->propertyNames().now), DontEnum); 494 495 putDirect(exec->propertyNames().length, 7, ReadOnly|DontDelete|DontEnum); 495 496 } … … 569 570 JSValue *DateObjectFuncImp::callAsFunction(ExecState* exec, JSObject*, const List& args) 570 571 { 571 if (id == Parse) {572 if (id == Parse) 572 573 return jsNumber(parseDate(args[0]->toString(exec))); 573 } 574 else { // UTC 574 else if (id == Now) 575 return jsNumber(getCurrentUTCTime()); 576 } else { // UTC 575 577 int n = args.size(); 576 578 if (isnan(args[0]->toNumber(exec))
Note:
See TracChangeset
for help on using the changeset viewer.