本文整理汇总了C++中JObject::raw_value方法的典型用法代码示例。如果您正苦于以下问题:C++ JObject::raw_value方法的具体用法?C++ JObject::raw_value怎么用?C++ JObject::raw_value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JObject
的用法示例。
在下文中一共展示了JObject::raw_value方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Call
JResult JObject::Call(JObject& this_, JArgList& arg) {
IOTJS_ASSERT(IsFunction());
JRawObjectType* this_obj_p = this_.IsNull() ? NULL
: this_.raw_value().v_object;
JRawValueType res;
JRawValueType* val_args = NULL;
uint16_t val_argv = 0;
if (arg.GetLength() > 0) {
val_argv = arg.GetLength();
val_args = new JRawValueType[val_argv];
for (int i = 0; i < val_argv; ++i) {
val_args[i] = arg.Get(i)->raw_value();
}
}
bool is_ok = jerry_api_call_function(_obj_val.v_object,
this_obj_p,
&res,
val_args,
val_argv);
if (val_args) {
delete [] val_args;
}
JResultType type = is_ok ? JRESULT_OK : JRESULT_EXCEPTION;
return JResult(&res, type);
}
示例2: set_jholder
void JObjectWrap::set_jholder(JObject& jholder) {
IOTJS_ASSERT(_jholder == NULL);
IOTJS_ASSERT(jholder.IsObject());
JRawValueType raw_value = jholder.raw_value();
_jholder = new JObject(&raw_value, false);
}
示例3: Throw
void JHandlerInfo::Throw(JObject& ret) {
IOTJS_ASSERT(_thrown == false);
ret.Ref();
*_ret_val_p = ret.raw_value();
_thrown = true;
}
示例4: SetProperty
void JObject::SetProperty(const char* name, const JObject& val) {
IOTJS_ASSERT(IsObject());
JRawValueType v = val.raw_value();
bool is_ok = jerry_api_set_object_field_value(
_obj_val.v_object,
reinterpret_cast<const jerry_api_char_t*>(name),
&v);
IOTJS_ASSERT(is_ok);
}
示例5: JObject
JObjectWrap::JObjectWrap(JObject& jobject)
: _jobject(NULL) {
IOTJS_ASSERT(jobject.IsObject());
// This wrapper hold pointer to the javascript object but never increase
// reference count.
JRawValueType raw_value = jobject.raw_value();
_jobject = new JObject(&raw_value, false);
// Set native pointer of the object to be this wrapper.
// If the object is freed by GC, the wrapper instance should also be freed.
_jobject->SetNative((uintptr_t)this, FreeObjectWrap);
}
示例6: Return
void JHandlerInfo::Return(JObject& ret) {
ret.Ref();
*_ret_val_p = ret.raw_value();
}