Lines Matching defs:value

27 JSHandle<JSTaggedValue> JsonStringifier::Stringify(const JSHandle<JSTaggedValue> &value,
119 JSTaggedValue serializeValue = GetSerializeValue(value, key, value, replacer);
179 const JSHandle<JSTaggedValue> &value,
182 JSTaggedValue tagValue = value.GetTaggedValue();
184 // If Type(value) is Object, then
185 if (value->IsECMAObject() || value->IsBigInt()) {
186 // a. Let toJSON be Get(value, "toJSON").
192 tagValue = value.GetTaggedValue();
195 // Let value be Call(toJSON, value, «key»).
196 EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread_, toJsonFun, value, undefined, 1);
200 // ii. ReturnIfAbrupt(value).
207 // a. Let value be Call(ReplacerFunction, holder, «key, value»).
208 const uint32_t argsLength = 2; // 2: «key, value»
209 JSHandle<JSTaggedValue> holder = SerializeHolder(object, value);
216 // b. ReturnIfAbrupt(value).
223 const JSHandle<JSTaggedValue> &value)
228 JSObject::CreateDataPropertyOrThrow(thread_, holder, holderKey, value);
235 JSTaggedValue JsonStringifier::SerializeJSONProperty(const JSHandle<JSTaggedValue> &value,
238 JSTaggedValue tagValue = value.GetTaggedValue();
242 // If value is false, return "false".
246 // If value is true, return "true".
250 // If value is null, return "null".
255 // If Type(value) is Number, then
257 // a. If value is finite, return ToString(value).
295 // If Type(value) is String, return QuoteJSONString(value).
375 bool JsonStringifier::PushValue(const JSHandle<JSTaggedValue> &value)
380 bool equal = JSTaggedValue::SameValue(stack_[i].GetTaggedValue(), value.GetTaggedValue());
386 stack_.emplace_back(value);
395 bool JsonStringifier::SerializeJSONObject(const JSHandle<JSTaggedValue> &value, const JSHandle<JSTaggedValue> &replacer)
403 ASSERT(!value->IsAccessor());
404 JSHandle<JSObject> obj(value);
406 if (UNLIKELY(value->IsJSProxy() || value->IsTypedArray())) { // serialize proxy and typedArray
412 JSHandle<JSTaggedValue> valueHandle = JSTaggedValue::GetProperty(thread_, value, handleKey_).GetValue();
414 JSTaggedValue serializeValue = GetSerializeValue(value, handleKey_, valueHandle, replacer);
448 JSTaggedValue serializeValue = GetSerializeValue(value, propList_[i], handleValue_, replacer);
477 THROW_TYPE_ERROR_AND_RETURN(thread_, "stack contains value, usually caused by circular structure", true);
524 bool JsonStringifier::SerializeJSArray(const JSHandle<JSTaggedValue> &value, const JSHandle<JSTaggedValue> &replacer)
526 // If state.[[Stack]] contains value, throw a TypeError exception because the structure is cyclical.
527 bool isContain = PushValue(value);
529 THROW_TYPE_ERROR_AND_RETURN(thread_, "stack contains value, usually caused by circular structure", true);
542 if (value->IsJSArray()) {
543 JSHandle<JSArray> jsArr(value);
545 } else if (value->IsJSSharedArray()) {
546 JSHandle<JSSharedArray> jsArr(value);
551 JSTaggedValue tagVal = ObjectFastOperator::FastGetPropertyByIndex(thread_, value.GetTaggedValue(), i);
554 tagVal = JSObject::CallGetter(thread_, AccessorData::Cast(tagVal.GetTaggedObject()), value);
564 JSTaggedValue serializeValue = GetSerializeValue(value, handleKey_, handleValue_, replacer);
651 JSTaggedValue value = numberDic->GetValue(index);
652 if (UNLIKELY(value.IsAccessor())) {
653 value = JSObject::CallGetter(thread_, AccessorData::Cast(value.GetTaggedObject()),
657 handleValue_.Update(value);
683 JSTaggedValue value;
688 value = attr.IsInlinedProps()
691 if (attr.IsInlinedProps() && value.IsHole()) {
694 if (UNLIKELY(value.IsAccessor())) {
695 value = JSObject::CallGetter(thread_, AccessorData::Cast(value.GetTaggedObject()),
700 handleValue_.Update(value);
706 handleValue_.Update(value);
721 JSTaggedValue value = nameDic->GetValue(hashIndex);
722 if (UNLIKELY(value.IsAccessor())) {
723 value = JSObject::CallGetter(thread_, AccessorData::Cast(value.GetTaggedObject()),
727 handleValue_.Update(value);
744 JSTaggedValue value;
748 value = attr.IsInlinedProps()
751 if (attr.IsInlinedProps() && value.IsHole()) {
754 if (UNLIKELY(value.IsAccessor())) {
755 value = JSObject::CallGetter(thread_, AccessorData::Cast(value.GetTaggedObject()),
759 handleValue_.Update(value);
778 JSTaggedValue value = nameDic->GetValue(index);
780 if (UNLIKELY(value.IsAccessor())) {
781 value = JSObject::CallGetter(thread_, AccessorData::Cast(value.GetTaggedObject()),
786 handleValue_.Update(value);
817 JSTaggedValue value = globalDic->GetValue(index);
818 if (UNLIKELY(value.IsAccessor())) {
819 value = JSObject::CallGetter(thread_, AccessorData::Cast(value.GetTaggedObject()),
823 handleValue_.Update(value);
852 JSTaggedValue value = nameDic->GetValue(index);
853 if (UNLIKELY(value.IsAccessor())) {
854 value = JSObject::CallGetter(thread_, AccessorData::Cast(value.GetTaggedObject()),
858 handleValue_.Update(value);
884 bool JsonStringifier::CheckStackPushSameValue(JSHandle<JSTaggedValue> value)
886 bool isContain = PushValue(value);
888 THROW_TYPE_ERROR_AND_RETURN(thread_, "stack contains value, usually caused by circular structure", true);