[Webkit-unassigned] [Bug 32699] [V8] Date binding support

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 18 01:38:28 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=32699


TAMURA, Kent <tkent at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #45131|                            |review-
               Flag|                            |




--- Comment #1 from TAMURA, Kent <tkent at chromium.org>  2009-12-18 01:38:28 PST ---
Created an attachment (id=45131)
 --> (https://bugs.webkit.org/attachment.cgi?id=45131)
Proposed patch

Generated code for "Date valueAsDate setter raises(DOMException)" will be like:

  static v8::Handle<v8::Value> valueAsDateAttrGetter(v8::Local<v8::String>
name, const v8::AccessorInfo& info) {
    INC_STATS("DOM.HTMLInputElement.valueAsDate._get");
    v8::Handle<v8::Object> holder = info.Holder();
    HTMLInputElement* imp = v8DOMWrapperToNode<HTMLInputElement>(info);
    double v = imp->valueAsDate();
    if (isnan(v) || isinf(v))
        return v8::Null();
    else
        return v8::Date::New(v);
  }

  static void valueAsDateAttrSetter(v8::Local<v8::String> name,
v8::Local<v8::Value> value, const v8::AccessorInfo& info) {
    INC_STATS("DOM.HTMLInputElement.valueAsDate._set");
    v8::Handle<v8::Object> holder = info.Holder();
    HTMLInputElement* imp = v8DOMWrapperToNode<HTMLInputElement>(info);
    double v = value->IsDate() ? value->NumberValue() :
std::numeric_limits<double>::quiet_NaN();
    ExceptionCode ec = 0;
    imp->setValueAsDate(v, ec);
    if (UNLIKELY(ec))
        V8Proxy::setDOMException(ec);
    return;
  }

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list