Example #1
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8HTMLHRElementTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "HTMLHRElement", V8HTMLElement::GetTemplate(), V8HTMLHRElement::internalFieldCount,
        HTMLHRElementAttrs, WTF_ARRAY_LENGTH(HTMLHRElementAttrs),
        0, 0);
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #2
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8AudioGainTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "AudioGain", V8AudioParam::GetTemplate(), V8AudioGain::internalFieldCount,
        0, 0,
        0, 0);
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #3
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8WebGLUnsignedIntArrayTemplate(v8::Persistent<v8::FunctionTemplate> desc) {
  v8::Local<v8::Signature> default_signature = configureTemplate(desc, "WebGLUnsignedIntArray",
      V8WebGLArray::GetTemplate(), V8WebGLUnsignedIntArray::internalFieldCount,
      NULL, 0,
      WebGLUnsignedIntArray_callbacks, sizeof(WebGLUnsignedIntArray_callbacks)/sizeof(*WebGLUnsignedIntArray_callbacks));
      desc->SetCallHandler(V8WebGLUnsignedIntArray::constructorCallback);
  v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
  v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
  

  // Custom toString template
  desc->Set(getToStringName(), getToStringTemplate());
  return desc;
}
static v8::Persistent<v8::FunctionTemplate> ConfigureV8SQLExceptionTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "SQLException", v8::Persistent<v8::FunctionTemplate>(), V8SQLException::internalFieldCount,
        SQLExceptionAttrs, sizeof(SQLExceptionAttrs) / sizeof(*SQLExceptionAttrs),
        0, 0);
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    
    batchConfigureConstants(desc, proto, SQLExceptionConsts, sizeof(SQLExceptionConsts) / sizeof(*SQLExceptionConsts));

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
static v8::Persistent<v8::FunctionTemplate> ConfigureV8MediaListTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "MediaList", v8::Persistent<v8::FunctionTemplate>(), V8MediaList::internalFieldCount,
        MediaListAttrs, sizeof(MediaListAttrs) / sizeof(*MediaListAttrs),
        MediaListCallbacks, sizeof(MediaListCallbacks) / sizeof(*MediaListCallbacks));
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    
    setCollectionStringOrNullIndexedGetter<MediaList>(desc);

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
static v8::Persistent<v8::FunctionTemplate> ConfigureV8XPathResultTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "XPathResult", v8::Persistent<v8::FunctionTemplate>(), V8XPathResult::internalFieldCount,
        XPathResultAttrs, sizeof(XPathResultAttrs) / sizeof(*XPathResultAttrs),
        XPathResultCallbacks, sizeof(XPathResultCallbacks) / sizeof(*XPathResultCallbacks));
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    
    batchConfigureConstants(desc, proto, XPathResultConsts, sizeof(XPathResultConsts) / sizeof(*XPathResultConsts));

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #7
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8EventExceptionTemplate(v8::Persistent<v8::FunctionTemplate> desc) {
  v8::Local<v8::Signature> default_signature = configureTemplate(desc, "EventException",
      v8::Persistent<v8::FunctionTemplate>(), V8EventException::internalFieldCount,
      EventException_attrs, sizeof(EventException_attrs)/sizeof(*EventException_attrs),
      NULL, 0);
  v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
  v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
  
  proto->Set(v8::String::New("toString"), v8::FunctionTemplate::New(EventExceptionInternal::toStringCallback, v8::Handle<v8::Value>(), default_signature), static_cast<v8::PropertyAttribute>(v8::DontDelete|v8::DontEnum));
  batchConfigureConstants(desc, proto, EventException_consts, sizeof(EventException_consts)/sizeof(*EventException_consts));

  // Custom toString template
  desc->Set(getToStringName(), getToStringTemplate());
  return desc;
}
Example #8
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8MessageChannelTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "MessageChannel", v8::Persistent<v8::FunctionTemplate>(), V8MessageChannel::internalFieldCount,
        MessageChannelAttrs, WTF_ARRAY_LENGTH(MessageChannelAttrs),
        0, 0);
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    desc->SetCallHandler(V8MessageChannel::constructorCallback);
    

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #9
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestExceptionTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestException", v8::Persistent<v8::FunctionTemplate>(), V8TestException::internalFieldCount,
        TestExceptionAttrs, WTF_ARRAY_LENGTH(TestExceptionAttrs),
        0, 0);
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #10
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8XPathNSResolverTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "XPathNSResolver", v8::Persistent<v8::FunctionTemplate>(), V8XPathNSResolver::internalFieldCount,
        0, 0,
        XPathNSResolverCallbacks, WTF_ARRAY_LENGTH(XPathNSResolverCallbacks));
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #11
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8HTMLOutputElementTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "HTMLOutputElement", V8HTMLElement::GetTemplate(), V8HTMLOutputElement::internalFieldCount,
        HTMLOutputElementAttrs, WTF_ARRAY_LENGTH(HTMLOutputElementAttrs),
        HTMLOutputElementCallbacks, WTF_ARRAY_LENGTH(HTMLOutputElementCallbacks));
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #12
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8Float32ArrayTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "Float32Array", V8ArrayBufferView::GetTemplate(), V8Float32Array::internalFieldCount,
        Float32ArrayAttrs, WTF_ARRAY_LENGTH(Float32ArrayAttrs),
        Float32ArrayCallbacks, WTF_ARRAY_LENGTH(Float32ArrayCallbacks));
        desc->SetCallHandler(V8Float32Array::constructorCallback);
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    
    batchConfigureConstants(desc, proto, Float32ArrayConsts, WTF_ARRAY_LENGTH(Float32ArrayConsts));

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #13
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8SVGFETurbulenceElementTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "SVGFETurbulenceElement", V8SVGElement::GetTemplate(), V8SVGFETurbulenceElement::internalFieldCount,
        SVGFETurbulenceElementAttrs, WTF_ARRAY_LENGTH(SVGFETurbulenceElementAttrs),
        SVGFETurbulenceElementCallbacks, WTF_ARRAY_LENGTH(SVGFETurbulenceElementCallbacks));
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    
    batchConfigureConstants(desc, proto, SVGFETurbulenceElementConsts, WTF_ARRAY_LENGTH(SVGFETurbulenceElementConsts));

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #14
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestSerializedScriptValueInterfaceTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = configureTemplate(desc, "TestSerializedScriptValueInterface", v8::Persistent<v8::FunctionTemplate>(), V8TestSerializedScriptValueInterface::internalFieldCount,
        TestSerializedScriptValueInterfaceAttrs, WTF_ARRAY_LENGTH(TestSerializedScriptValueInterfaceAttrs),
        0, 0);
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    desc->SetCallHandler(V8TestSerializedScriptValueInterface::constructorCallback);
    

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
static v8::Persistent<v8::FunctionTemplate> ConfigureV8HTMLObjectElementTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "HTMLObjectElement", V8HTMLElement::GetTemplate(), V8HTMLObjectElement::internalFieldCount,
        HTMLObjectElementAttrs, sizeof(HTMLObjectElementAttrs) / sizeof(*HTMLObjectElementAttrs),
        HTMLObjectElementCallbacks, sizeof(HTMLObjectElementCallbacks) / sizeof(*HTMLObjectElementCallbacks));
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    
    desc->InstanceTemplate()->SetIndexedPropertyHandler(V8HTMLObjectElement::indexedPropertyGetter, V8HTMLObjectElement::indexedPropertySetter, 0, 0);
    desc->InstanceTemplate()->SetNamedPropertyHandler(V8HTMLObjectElement::namedPropertyGetter, V8HTMLObjectElement::namedPropertySetter, 0, 0, 0);
    desc->InstanceTemplate()->SetCallAsFunctionHandler(V8HTMLObjectElement::callAsFunctionCallback);

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #16
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestNodeTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = configureTemplate(desc, "TestNode", V8Node::GetTemplate(), V8TestNode::internalFieldCount,
        0, 0,
        0, 0);
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    desc->SetCallHandler(V8TestNode::constructorCallback);
    

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #17
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8WorkerLocationTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "WorkerLocation", v8::Persistent<v8::FunctionTemplate>(), V8WorkerLocation::internalFieldCount,
        WorkerLocationAttrs, WTF_ARRAY_LENGTH(WorkerLocationAttrs),
        0, 0);
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    
    proto->Set(v8::String::New("toString"), v8::FunctionTemplate::New(WorkerLocationInternal::toStringCallback, v8::Handle<v8::Value>(), defaultSignature), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::DontEnum));

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #18
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8SQLExceptionTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "SQLException", v8::Persistent<v8::FunctionTemplate>(), V8SQLException::internalFieldCount,
        SQLExceptionAttrs, WTF_ARRAY_LENGTH(SQLExceptionAttrs),
        0, 0);
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    
    batchConfigureConstants(desc, proto, SQLExceptionConsts, WTF_ARRAY_LENGTH(SQLExceptionConsts));

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #19
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8HTMLCollectionTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "HTMLCollection", v8::Persistent<v8::FunctionTemplate>(), V8HTMLCollection::internalFieldCount,
        HTMLCollectionAttrs, WTF_ARRAY_LENGTH(HTMLCollectionAttrs),
        HTMLCollectionCallbacks, WTF_ARRAY_LENGTH(HTMLCollectionCallbacks));
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    
    setCollectionIndexedGetter<HTMLCollection, Node>(desc);
    desc->InstanceTemplate()->SetNamedPropertyHandler(V8HTMLCollection::namedPropertyGetter, 0, 0, 0, 0);
    desc->InstanceTemplate()->SetCallAsFunctionHandler(V8HTMLCollection::callAsFunctionCallback);

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #20
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8WebKitCSSTransformValueTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "WebKitCSSTransformValue", V8CSSValueList::GetTemplate(), V8WebKitCSSTransformValue::internalFieldCount,
        WebKitCSSTransformValueAttrs, WTF_ARRAY_LENGTH(WebKitCSSTransformValueAttrs),
        0, 0);
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    
    setCollectionIndexedGetter<WebKitCSSTransformValue, CSSValue>(desc);
    batchConfigureConstants(desc, proto, WebKitCSSTransformValueConsts, WTF_ARRAY_LENGTH(WebKitCSSTransformValueConsts));

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #21
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8TextEventTemplate(v8::Persistent<v8::FunctionTemplate> desc) {
  v8::Local<v8::Signature> default_signature = configureTemplate(desc, "TextEvent",
      V8UIEvent::GetTemplate(), V8TextEvent::internalFieldCount,
      TextEvent_attrs, sizeof(TextEvent_attrs)/sizeof(*TextEvent_attrs),
      NULL, 0);
  v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
  v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
  

  // Custom Signature 'initTextEvent'
  const int initTextEvent_argc = 5;
  v8::Handle<v8::FunctionTemplate> initTextEvent_argv[initTextEvent_argc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8DOMWindow::GetRawTemplate(), v8::Handle<v8::FunctionTemplate>() };
  v8::Handle<v8::Signature> initTextEvent_signature = v8::Signature::New(desc, initTextEvent_argc, initTextEvent_argv);
  proto->Set(v8::String::New("initTextEvent"), v8::FunctionTemplate::New(TextEventInternal::initTextEventCallback, v8::Handle<v8::Value>(), initTextEvent_signature));

  // Custom toString template
  desc->Set(getToStringName(), getToStringTemplate());
  return desc;
}
static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestMediaQueryListListenerTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = configureTemplate(desc, "TestMediaQueryListListener", v8::Persistent<v8::FunctionTemplate>(), V8TestMediaQueryListListener::internalFieldCount,
        0, 0,
        TestMediaQueryListListenerCallbacks, WTF_ARRAY_LENGTH(TestMediaQueryListListenerCallbacks));
    UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    UNUSED_PARAM(instance); // In some cases, it will not be used.
    UNUSED_PARAM(proto); // In some cases, it will not be used.
    

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #23
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8XMLHttpRequestUploadTemplate(v8::Persistent<v8::FunctionTemplate> desc) {
  v8::Local<v8::Signature> default_signature = configureTemplate(desc, "XMLHttpRequestUpload",
      v8::Persistent<v8::FunctionTemplate>(), V8XMLHttpRequestUpload::internalFieldCount,
      XMLHttpRequestUpload_attrs, sizeof(XMLHttpRequestUpload_attrs)/sizeof(*XMLHttpRequestUpload_attrs),
      XMLHttpRequestUpload_callbacks, sizeof(XMLHttpRequestUpload_callbacks)/sizeof(*XMLHttpRequestUpload_callbacks));
  v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
  v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
  

  // Custom Signature 'dispatchEvent'
  const int dispatchEvent_argc = 1;
  v8::Handle<v8::FunctionTemplate> dispatchEvent_argv[dispatchEvent_argc] = { V8Event::GetRawTemplate() };
  v8::Handle<v8::Signature> dispatchEvent_signature = v8::Signature::New(desc, dispatchEvent_argc, dispatchEvent_argv);
  proto->Set(v8::String::New("dispatchEvent"), v8::FunctionTemplate::New(XMLHttpRequestUploadInternal::dispatchEventCallback, v8::Handle<v8::Value>(), dispatchEvent_signature));

  // Custom toString template
  desc->Set(getToStringName(), getToStringTemplate());
  return desc;
}
Example #24
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8SVGMarkerElementTemplate(v8::Persistent<v8::FunctionTemplate> desc)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "SVGMarkerElement", V8SVGElement::GetTemplate(), V8SVGMarkerElement::internalFieldCount,
        SVGMarkerElementAttrs, WTF_ARRAY_LENGTH(SVGMarkerElementAttrs),
        SVGMarkerElementCallbacks, WTF_ARRAY_LENGTH(SVGMarkerElementCallbacks));
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    

    // Custom Signature 'setOrientToAngle'
    const int setOrientToAngleArgc = 1;
    v8::Handle<v8::FunctionTemplate> setOrientToAngleArgv[setOrientToAngleArgc] = { V8SVGAngle::GetRawTemplate() };
    v8::Handle<v8::Signature> setOrientToAngleSignature = v8::Signature::New(desc, setOrientToAngleArgc, setOrientToAngleArgv);
    proto->Set(v8::String::New("setOrientToAngle"), v8::FunctionTemplate::New(SVGMarkerElementInternal::setOrientToAngleCallback, v8::Handle<v8::Value>(), setOrientToAngleSignature));
    batchConfigureConstants(desc, proto, SVGMarkerElementConsts, WTF_ARRAY_LENGTH(SVGMarkerElementConsts));

    // Custom toString template
    desc->Set(getToStringName(), getToStringTemplate());
    return desc;
}
Example #25
0
static v8::Persistent<v8::FunctionTemplate> ConfigureV8LocationTemplate(v8::Persistent<v8::FunctionTemplate> desc) {
  v8::Local<v8::Signature> default_signature = configureTemplate(desc, "Location",
      v8::Persistent<v8::FunctionTemplate>(), V8Location::internalFieldCount,
      Location_attrs, sizeof(Location_attrs)/sizeof(*Location_attrs),
      NULL, 0);
  v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
  v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
  instance->SetAccessCheckCallbacks(V8Location::namedSecurityCheck, V8Location::indexedSecurityCheck, v8::Integer::New(V8ClassIndex::ToInt(V8ClassIndex::LOCATION)));
  instance->Set(v8::String::New("assign"), v8::FunctionTemplate::New(V8Location::assignCallback, v8::Handle<v8::Value>(), default_signature));
  instance->Set(v8::String::New("replace"), v8::FunctionTemplate::New(V8Location::replaceCallback, v8::Handle<v8::Value>(), default_signature));
  instance->Set(v8::String::New("reload"), v8::FunctionTemplate::New(V8Location::reloadCallback, v8::Handle<v8::Value>(), default_signature));
  instance->Set(v8::String::New("toString"), v8::FunctionTemplate::New(V8Location::toStringCallback, v8::Handle<v8::Value>(), default_signature), static_cast<v8::PropertyAttribute>(v8::DontDelete|v8::DontEnum|v8::ReadOnly));
  instance->Set(v8::String::New("valueOf"), v8::FunctionTemplate::New(V8Location::valueOfCallback, v8::Handle<v8::Value>(), default_signature), static_cast<v8::PropertyAttribute>(v8::DontDelete|v8::DontEnum|v8::ReadOnly));

  // For security reasons, these functions are on the instance instead
  // of on the prototype object to insure that they cannot be overwritten.
  instance->SetAccessor(v8::String::New("reload"), V8Location::reloadAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
  instance->SetAccessor(v8::String::New("replace"), V8Location::replaceAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
  instance->SetAccessor(v8::String::New("assign"), V8Location::assignAccessorGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));

  // Custom toString template
  desc->Set(getToStringName(), getToStringTemplate());
  return desc;
}