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


C++ Local::GetConstructorName方法代码示例

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


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

示例1: IsInheritTemplate

	bool IsInheritTemplate(Handle<Value> val,uint tid){
		if(!val->IsObject()) return false;
		Local<Function> func = GetEnv()->GetTemplate(tid)->GetFunction();
		Local<Object> obj = val->ToObject()->GetPrototype()->ToObject();
		while(true){
			if(obj->GetPrototype()->IsNull()) return false;
			if(obj->GetConstructorName()==func->GetName()->ToString()) return true;
			obj = obj->GetPrototype()->ToObject();
		}
	}
开发者ID:pgmsoul,项目名称:GitLib,代码行数:10,代码来源:v8base.cpp

示例2: exists

        TEST_F(JSDeviceTest, createIstance) {
            V8_SETUP

            EXPECT_CALL(*zDevices.get(), exists(extAddress)).WillOnce(Return(true));

            v8::Local<v8::Value> result = runScript(creatingZDeviceScript + "a;");
            String::Utf8Value utf8(result);
            ASSERT_THAT(result.IsEmpty(), false);
            ASSERT_THAT(result->IsObject(), true);
            Local<Object> object = result->ToObject();

            ASSERT_THAT(object->GetConstructorName(), IsString(JSZDEVICE));
        }
开发者ID:paoloach,项目名称:zdomus,代码行数:13,代码来源:JSDeviceTest.cpp

示例3: exists

TEST_F( JSEndpointTest, createIstance) {
	ZEndpoint zEndpoint { NWK_ADDRESS, ENDPOINT_ID, PROFILE_ID, DEVICE_ID, DEVICE_VER, IN_CLUSTERS, OUT_CLUSTERS };
	ZDevice zDevice { extAddress, NWK_ADDRESS, 0, { zEndpoint } };
	std::stringstream stream { };
	stream << JSZENDPOINT << "('" << EXTENDED_ADDRESS << "', " << ENDPOINT_ID << ");";
	V8_SETUP
	jsEndpoint->initJsObjectsTemplate(isolate, global);

	EXPECT_CALL(*zDevices.get(), exists(extAddress)).WillOnce(Return(true));
	EXPECT_CALL(*zDevices.get(), getDevice(extAddress)).WillOnce(Return(&zDevice));

	v8::Local<v8::Value> result = runScript(stream.str());
	ASSERT_THAT(result.IsEmpty(), false);
	ASSERT_THAT(result->IsObject(), true);
	Local<Object> object = result->ToObject();

	ASSERT_THAT(object->GetConstructorName(), IsString(JSZENDPOINT));
}
开发者ID:paoloach,项目名称:zdomus,代码行数:18,代码来源:JSEndpointTest.cpp

示例4: createIstanceTest

        void JSAttributeTest::createIstanceTest(const std::string &attributeName, std::shared_ptr<JSZAttribute> &jsZAttribute,
                                                std::shared_ptr<ZCLAttribute> attributeMock) {
            ZEndpoint zEndpoint{NWK_ADDRESS, ENDPOINT_ID, PROFILE_ID, DEVICE_ID, DEVICE_VER, IN_CLUSTERS, OUT_CLUSTERS};
            ZDevice zDevice{extAddress, NWK_ADDRESS, 0, {zEndpoint}};
            std::stringstream stream{};
            stream << attributeName << "('" << EXTENDED_ADDRESS << "', " << ENDPOINT_ID << ", " << CLUSTER_ID << "," << ATTRIBUTE0_ID << ");";
            V8_SETUP
            jsZAttribute->initJsObjectsTemplate(isolate, global);

            EXPECT_CALL(*zDevices, exists(extAddress)).WillOnce(Return(true));
            EXPECT_CALL(*zDevices, getDevice(extAddress)).WillOnce(Return(&zDevice));
            EXPECT_CALL(*clusterTypeFactoryMock, getCluster(CLUSTER_ID, zigbeeDevice, ENDPOINT_ID, NWK_ADDRESS)).WillOnce(Return(cluster));
            EXPECT_CALL(*cluster, getAttribute(ATTRIBUTE0_ID)).WillOnce(Return(attributeMock));

            v8::Local<v8::Value> result = runScript(stream.str());

            ASSERT_THAT(result.IsEmpty(), false);
            ASSERT_THAT(result->IsObject(), true);
            Local<Object> object = result->ToObject();

            ASSERT_THAT(object->GetConstructorName(), IsString(attributeName));
        }
开发者ID:paoloach,项目名称:zdomus,代码行数:22,代码来源:JSAttributeTest.cpp


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