当前位置: 首页>>代码示例>>C++>>正文


C++ Handle::PrototypeTemplate方法代码示例

本文整理汇总了C++中v8::Handle::PrototypeTemplate方法的典型用法代码示例。如果您正苦于以下问题:C++ Handle::PrototypeTemplate方法的具体用法?C++ Handle::PrototypeTemplate怎么用?C++ Handle::PrototypeTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在v8::Handle的用法示例。


在下文中一共展示了Handle::PrototypeTemplate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: installAttributes

v8::Local<v8::Signature> V8DOMConfiguration::installDOMClassTemplate(v8::Handle<v8::FunctionTemplate> functionDescriptor, const char* interfaceName, v8::Handle<v8::FunctionTemplate> parentClass, size_t fieldCount,
    const AttributeConfiguration* attributes, size_t attributeCount,
    const AccessorConfiguration* accessors, size_t accessorCount,
    const MethodConfiguration* callbacks, size_t callbackCount,
    v8::Isolate* isolate)
{
    functionDescriptor->SetClassName(v8AtomicString(isolate, interfaceName));
    v8::Local<v8::ObjectTemplate> instanceTemplate = functionDescriptor->InstanceTemplate();
    instanceTemplate->SetInternalFieldCount(fieldCount);
    if (!parentClass.IsEmpty()) {
        functionDescriptor->Inherit(parentClass);
        // Marks the prototype object as one of native-backed objects.
        // This is needed since bug 110436 asks WebKit to tell native-initiated prototypes from pure-JS ones.
        // This doesn't mark kinds "root" classes like Node, where setting this changes prototype chain structure.
        v8::Local<v8::ObjectTemplate> prototype = functionDescriptor->PrototypeTemplate();
        prototype->SetInternalFieldCount(v8PrototypeInternalFieldcount);
    }

    v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, functionDescriptor);
    if (attributeCount)
        installAttributes(instanceTemplate, functionDescriptor->PrototypeTemplate(), attributes, attributeCount, isolate);
    if (accessorCount)
        installAccessors(functionDescriptor->PrototypeTemplate(), defaultSignature, accessors, accessorCount, isolate);
    if (callbackCount)
        installCallbacks(functionDescriptor->PrototypeTemplate(), defaultSignature, static_cast<v8::PropertyAttribute>(v8::DontDelete), callbacks, callbackCount, isolate);
    return defaultSignature;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:27,代码来源:V8DOMConfiguration.cpp

示例2:

static v8::Handle<v8::FunctionTemplate> ConfigureV8TestConstantsTemplate(v8::Handle<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorldType)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "TestConstants", v8::Local<v8::FunctionTemplate>(), V8TestConstants::internalFieldCount,
        0, 0,
        0, 0, isolate, currentWorldType);
    UNUSED_PARAM(defaultSignature);
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    UNUSED_PARAM(instance);
    UNUSED_PARAM(proto);
    static const V8DOMConfiguration::ConstantConfiguration V8TestConstantsConstants[] = {
        {"CONST_VALUE_0", 0},
        {"CONST_VALUE_1", 1},
        {"CONST_VALUE_2", 2},
        {"CONST_VALUE_4", 4},
        {"CONST_VALUE_8", 8},
        {"CONST_VALUE_9", -1},
        {"CONST_VALUE_10", "my constant string"},
        {"CONST_VALUE_11", 0xffffffff},
        {"CONST_VALUE_12", 0x01},
        {"CONST_VALUE_13", 0X20},
        {"CONST_VALUE_14", 0x1abc},
        {"CONST_VALUE_15", 010},
        {"CONST_VALUE_16", -010},
        {"CONST_VALUE_16", -0x1A},
        {"CONST_VALUE_17", -0X1a},
        {"DEPRECATED_CONSTANT", 1},
        {"CONST_JAVASCRIPT", 1},
    };
    V8DOMConfiguration::installConstants(desc, proto, V8TestConstantsConstants, WTF_ARRAY_LENGTH(V8TestConstantsConstants), isolate);
    if (RuntimeEnabledFeatures::featureNameEnabled()) {
        static const V8DOMConfiguration::ConstantConfiguration constantConfiguration = {"FEATURE_ENABLED_CONST", static_cast<signed int>(1)};
        V8DOMConfiguration::installConstants(desc, proto, &constantConfiguration, 1, isolate);
    }
    COMPILE_ASSERT(0 == TestConstants::CONST_VALUE_0, TheValueOfTestConstants_CONST_VALUE_0DoesntMatchWithImplementation);
    COMPILE_ASSERT(1 == TestConstants::CONST_VALUE_1, TheValueOfTestConstants_CONST_VALUE_1DoesntMatchWithImplementation);
    COMPILE_ASSERT(2 == TestConstants::CONST_VALUE_2, TheValueOfTestConstants_CONST_VALUE_2DoesntMatchWithImplementation);
    COMPILE_ASSERT(4 == TestConstants::CONST_VALUE_4, TheValueOfTestConstants_CONST_VALUE_4DoesntMatchWithImplementation);
    COMPILE_ASSERT(8 == TestConstants::CONST_VALUE_8, TheValueOfTestConstants_CONST_VALUE_8DoesntMatchWithImplementation);
    COMPILE_ASSERT(-1 == TestConstants::CONST_VALUE_9, TheValueOfTestConstants_CONST_VALUE_9DoesntMatchWithImplementation);
    COMPILE_ASSERT("my constant string" == TestConstants::CONST_VALUE_10, TheValueOfTestConstants_CONST_VALUE_10DoesntMatchWithImplementation);
    COMPILE_ASSERT(0xffffffff == TestConstants::CONST_VALUE_11, TheValueOfTestConstants_CONST_VALUE_11DoesntMatchWithImplementation);
    COMPILE_ASSERT(0x01 == TestConstants::CONST_VALUE_12, TheValueOfTestConstants_CONST_VALUE_12DoesntMatchWithImplementation);
    COMPILE_ASSERT(0X20 == TestConstants::CONST_VALUE_13, TheValueOfTestConstants_CONST_VALUE_13DoesntMatchWithImplementation);
    COMPILE_ASSERT(0x1abc == TestConstants::CONST_VALUE_14, TheValueOfTestConstants_CONST_VALUE_14DoesntMatchWithImplementation);
    COMPILE_ASSERT(010 == TestConstants::CONST_VALUE_15, TheValueOfTestConstants_CONST_VALUE_15DoesntMatchWithImplementation);
    COMPILE_ASSERT(-010 == TestConstants::CONST_VALUE_16, TheValueOfTestConstants_CONST_VALUE_16DoesntMatchWithImplementation);
    COMPILE_ASSERT(-0x1A == TestConstants::CONST_VALUE_16, TheValueOfTestConstants_CONST_VALUE_16DoesntMatchWithImplementation);
    COMPILE_ASSERT(-0X1a == TestConstants::CONST_VALUE_17, TheValueOfTestConstants_CONST_VALUE_17DoesntMatchWithImplementation);
    COMPILE_ASSERT(1 == TestConstants::DEPRECATED_CONSTANT, TheValueOfTestConstants_DEPRECATED_CONSTANTDoesntMatchWithImplementation);
    COMPILE_ASSERT(1 == TestConstants::FEATURE_ENABLED_CONST, TheValueOfTestConstants_FEATURE_ENABLED_CONSTDoesntMatchWithImplementation);
    COMPILE_ASSERT(1 == TestConstants::CONST_IMPL, TheValueOfTestConstants_CONST_IMPLDoesntMatchWithImplementation);

    // Custom toString template
    desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
    return desc;
}
开发者ID:halton,项目名称:blink-crosswalk,代码行数:60,代码来源:V8TestConstants.cpp

示例3:

static void configureV8TestInterfaceCheckSecurityTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
{
    functionTemplate->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfaceCheckSecurity", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceCheckSecurity::internalFieldCount,
        V8TestInterfaceCheckSecurityAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityAttributes),
        0, 0,
        V8TestInterfaceCheckSecurityMethods, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityMethods),
        isolate);
    v8::Local<v8::ObjectTemplate> instanceTemplate ALLOW_UNUSED = functionTemplate->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> prototypeTemplate ALLOW_UNUSED = functionTemplate->PrototypeTemplate();
    instanceTemplate->SetAccessCheckCallbacks(TestInterfaceCheckSecurityV8Internal::namedSecurityCheck, TestInterfaceCheckSecurityV8Internal::indexedSecurityCheck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestInterfaceCheckSecurity::wrapperTypeInfo)));
    prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
    prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityDoNotCheckSignatureVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
    if (DOMWrapperWorld::current(isolate).isMainWorld()) {
        prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityPerWorldBindingsVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
    } else {
        prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityPerWorldBindingsVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
    }
    prototypeTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityReadOnlyVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
    instanceTemplate->SetAccessor(v8AtomicString(isolate, "doNotCheckSecurityUnforgeableVoidMethod"), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));

    // Custom toString template
    functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
}
开发者ID:coinpayee,项目名称:blink,代码行数:26,代码来源:V8TestInterfaceCheckSecurity.cpp

示例4: initClass

static v8::Local<v8::Function> initClass(v8::Handle<v8::FunctionTemplate>& temp) {
    HandleScope scope;

    Local<ObjectTemplate> obj = temp->PrototypeTemplate();
    EXPOSE_METHOD(obj, bindToUnit, ReadOnly | DontDelete);

    return scope.Close(temp->GetFunction());
}
开发者ID:hurry07,项目名称:opengl_android,代码行数:8,代码来源:TextureAtlas.cpp

示例5: initClass

static v8::Local<v8::Function> initClass(v8::Handle<v8::FunctionTemplate>& temp) {
    HandleScope scope;

    Local<ObjectTemplate> obj = temp->PrototypeTemplate();
    obj->SetAccessor(String::New("byteLength"), byteLength);
    EXPOSE_METHOD(obj, slice, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, isView, ReadOnly | DontDelete);
    obj->Set(String::New("clone"), FunctionTemplate::New(ClassWrap<NodeBuffer>::clone));

    return scope.Close(temp->GetFunction());
}
开发者ID:hurry07,项目名称:opengl_android,代码行数:11,代码来源:arraybuffer.cpp

示例6: initClass

static v8::Local<v8::Function> initClass(v8::Handle<v8::FunctionTemplate>& temp) {
    HandleScope scope;
    
    Local<ObjectTemplate> obj = temp->PrototypeTemplate();
    EXPOSE_METHOD(obj, get, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, isNearDeath, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, isDead, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, callbacks, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, addCallback, ReadOnly | DontDelete);
    
    return scope.Close(temp->GetFunction());
}
开发者ID:hurry07,项目名称:v8,代码行数:12,代码来源:WeakRef.cpp

示例7: initClass

static v8::Local<v8::Function> initClass(v8::Handle<v8::FunctionTemplate>& temp) {
    HandleScope scope;

    Local<ObjectTemplate> obj = temp->PrototypeTemplate();
    
    EXPOSE_METHOD(obj, values, ReadOnly | DontDelete);
//    EXPOSE_METHOD(obj, measure, ReadOnly | DontDelete);
//    EXPOSE_METHOD(obj, glyphs, ReadOnly | DontDelete);
//    EXPOSE_METHOD(obj, outline_type, ReadOnly | DontDelete);
//    EXPOSE_METHOD(obj, outline_thickness, ReadOnly | DontDelete);
    
    return scope.Close(temp->GetFunction());
}
开发者ID:hurry07,项目名称:opengl_android,代码行数:13,代码来源:AutoRelease.cpp

示例8: initClass

static v8::Local<v8::Function> initClass(v8::Handle<v8::FunctionTemplate>& temp) {
    HandleScope scope;

    Local<ObjectTemplate> obj = temp->PrototypeTemplate();
    EXPOSE_METHOD(obj, dotVec2, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, dotVec3, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, dotVec4, ReadOnly | DontDelete);

    EXPOSE_METHOD(obj, mulVec2, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, mulVec3, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, mulVec4, ReadOnly | DontDelete);

    EXPOSE_METHOD(obj, crossVec3, ReadOnly | DontDelete);

    EXPOSE_METHOD(obj, addVec2, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, addVec3, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, addVec4, ReadOnly | DontDelete);
    
    EXPOSE_METHOD(obj, subVec2, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, subVec3, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, subVec4, ReadOnly | DontDelete);

    EXPOSE_METHOD(obj, scaleVec2f, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, scaleVec3f, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, scaleVec4f, ReadOnly | DontDelete);

    EXPOSE_METHOD(obj, mulMV4, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, mulMV3, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, inverse, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, mulMM, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, setTranslation, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, identity, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, perspective, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, ortho, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, frustum, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, lookAt, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, translate, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, rotateX, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, rotateY, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, rotateZ, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, rotate, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, scale, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, transpose, ReadOnly | DontDelete);

    EXPOSE_METHOD(obj, translation, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, scaling, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, nodeMatrix, ReadOnly | DontDelete);

    return scope.Close(temp->GetFunction());
}
开发者ID:hurry07,项目名称:opengl_android,代码行数:50,代码来源:glmopt.cpp

示例9:

static void installV8SVGTestInterfaceTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
{
    functionTemplate->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "SVGTestInterface", v8::Local<v8::FunctionTemplate>(), V8SVGTestInterface::internalFieldCount,
        V8SVGTestInterfaceAttributes, WTF_ARRAY_LENGTH(V8SVGTestInterfaceAttributes),
        0, 0,
        0, 0,
        isolate);
    v8::Local<v8::ObjectTemplate> instanceTemplate ALLOW_UNUSED = functionTemplate->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> prototypeTemplate ALLOW_UNUSED = functionTemplate->PrototypeTemplate();

    // Custom toString template
    functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
}
开发者ID:xin3liang,项目名称:platform_external_chromium_org_third_party_WebKit,代码行数:16,代码来源:V8SVGTestInterface.cpp

示例10:

static void configureV8TestInterfaceEventTargetTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
{
    functionTemplate->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfaceEventTarget", V8EventTarget::domTemplate(isolate), V8TestInterfaceEventTarget::internalFieldCount,
        0, 0,
        0, 0,
        0, 0,
        isolate);
    v8::Local<v8::ObjectTemplate> instanceTemplate ALLOW_UNUSED = functionTemplate->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> prototypeTemplate ALLOW_UNUSED = functionTemplate->PrototypeTemplate();

    // Custom toString template
    functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
}
开发者ID:coinpayee,项目名称:blink,代码行数:16,代码来源:V8TestInterfaceEventTarget.cpp

示例11:

static void configureV8TestInterfacePython3Template(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
{
    functionTemplate->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfacePython3", v8::Local<v8::FunctionTemplate>(), V8TestInterfacePython3::internalFieldCount,
        0, 0,
        0, 0,
        0, 0,
        isolate, currentWorldType);
    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();

    // Custom toString template
    functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::current()->toStringTemplate());
}
开发者ID:Tkkg1994,项目名称:Platfrom-kccat6,代码行数:16,代码来源:V8TestInterfacePython3.cpp

示例12: initClass

static v8::Local<v8::Function> initClass(v8::Handle<v8::FunctionTemplate>& temp) {
    HandleScope scope;

    Local<ObjectTemplate> obj = temp->PrototypeTemplate();
    obj->SetAccessor(String::New("height"), height);
    obj->SetAccessor(String::New("ascender"), ascender);
    obj->SetAccessor(String::New("descender"), descender);

    EXPOSE_METHOD(obj, load, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, measure, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, glyphs, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, outline_type, ReadOnly | DontDelete);
    EXPOSE_METHOD(obj, outline_thickness, ReadOnly | DontDelete);

    return scope.Close(temp->GetFunction());
}
开发者ID:hurry07,项目名称:v8,代码行数:16,代码来源:Font.cpp

示例13:

static v8::Handle<v8::FunctionTemplate> ConfigureV8TestNamedConstructorTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
{
    functionTemplate->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestNamedConstructor", v8::Local<v8::FunctionTemplate>(), V8TestNamedConstructor::internalFieldCount,
        0, 0,
        0, 0,
        0, 0,
        isolate, currentWorldType);
    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();

    // Custom toString template
    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
    return functionTemplate;
}
开发者ID:,项目名称:,代码行数:17,代码来源:

示例14:

static v8::Handle<v8::FunctionTemplate> ConfigureV8TestMediaQueryListListenerTemplate(v8::Handle<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorldType)
{
    desc->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "TestMediaQueryListListener", v8::Local<v8::FunctionTemplate>(), V8TestMediaQueryListListener::internalFieldCount,
        0, 0,
        V8TestMediaQueryListListenerMethods, WTF_ARRAY_LENGTH(V8TestMediaQueryListListenerMethods), isolate, currentWorldType);
    UNUSED_PARAM(defaultSignature);
    v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
    UNUSED_PARAM(instance);
    UNUSED_PARAM(proto);

    // Custom toString template
    desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
    return desc;
}
开发者ID:halton,项目名称:blink-crosswalk,代码行数:18,代码来源:V8TestMediaQueryListListener.cpp

示例15:

static void configureV8TestSpecialOperationsCustomTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
{
    functionTemplate->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestSpecialOperationsCustom", v8::Local<v8::FunctionTemplate>(), V8TestSpecialOperationsCustom::internalFieldCount,
        0, 0,
        0, 0,
        0, 0,
        isolate, currentWorldType);
    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
    functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestSpecialOperationsCustomV8Internal::indexedPropertyGetterCallback, TestSpecialOperationsCustomV8Internal::indexedPropertySetterCallback, 0, TestSpecialOperationsCustomV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestSpecialOperationsCustom>);
    functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestSpecialOperationsCustomV8Internal::namedPropertyGetterCallback, TestSpecialOperationsCustomV8Internal::namedPropertySetterCallback, TestSpecialOperationsCustomV8Internal::namedPropertyQueryCallback, TestSpecialOperationsCustomV8Internal::namedPropertyDeleterCallback, TestSpecialOperationsCustomV8Internal::namedPropertyEnumeratorCallback);

    // Custom toString template
    functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::current()->toStringTemplate());
}
开发者ID:kublaj,项目名称:blink,代码行数:18,代码来源:V8TestSpecialOperationsCustom.cpp


注:本文中的v8::Handle::PrototypeTemplate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。