Lines Matching refs:thread
25 JSHandle<JSProxy> JSProxy::ProxyCreate(JSThread *thread, const JSHandle<JSTaggedValue> &target,
30 THROW_TYPE_ERROR_AND_RETURN(thread, "ProxyCreate: target is not Object",
31 JSHandle<JSProxy>(thread, JSTaggedValue::Exception()));
36 THROW_TYPE_ERROR_AND_RETURN(thread, "ProxyCreate: handler is not Object",
37 JSHandle<JSProxy>(thread, JSTaggedValue::Exception()));
44 return thread->GetEcmaVM()->GetFactory()->NewJSProxy(target, handler);
48 JSTaggedValue JSProxy::GetPrototype(JSThread *thread, const JSHandle<JSProxy> &proxy)
50 STACK_LIMIT_CHECK(thread, JSTaggedValue::Exception());
51 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
53 JSHandle<JSTaggedValue> handler(thread, proxy->GetHandler());
56 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetPrototype: handler is null", JSTaggedValue::Exception());
61 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget());
64 JSHandle<JSTaggedValue> trap = JSObject::GetMethod(thread, handler, name);
66 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
70 return JSTaggedValue::GetPrototype(thread, targetHandle);
74 EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, trap, handler, undefined, 1);
75 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
80 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
83 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetPrototype: Type(handlerProto) is neither Object nor Null",
89 if (targetHandle->IsExtensible(thread)) {
92 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
95 JSTaggedValue targetProto = JSTaggedValue::GetPrototype(thread, targetHandle);
97 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
100 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetPrototype: SameValue(handlerProto, targetProto) is false",
108 bool JSProxy::SetPrototype(JSThread *thread, const JSHandle<JSProxy> &proxy, const JSHandle<JSTaggedValue> &proto)
110 STACK_LIMIT_CHECK(thread, false);
111 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
118 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::SetPrototype: handler is null", false);
123 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget());
126 JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler), name));
128 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
132 return JSTaggedValue::SetPrototype(thread, targetHandle, proto);
134 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler());
137 EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, trap, handlerTag, undefined, argsLength);
138 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
141 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
152 if (targetHandle->IsExtensible(thread)) {
155 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
158 JSTaggedValue targetProto = JSTaggedValue::GetPrototype(thread, targetHandle);
160 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
164 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::SetPrototype: TypeError of targetProto and Result", false);
171 bool JSProxy::IsExtensible(JSThread *thread, const JSHandle<JSProxy> &proxy)
173 STACK_LIMIT_CHECK(thread, false);
174 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
179 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::IsExtensible: handler is null", false);
184 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget());
187 JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler), name));
189 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
193 return targetHandle->IsExtensible(thread);
196 JSHandle<JSTaggedValue> newTgt(thread, JSTaggedValue::Undefined());
197 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler());
199 EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, trap, handlerTag, undefined, 1);
200 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
203 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
206 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
212 if (targetHandle->IsExtensible(thread) != booleanTrapResult) {
213 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::IsExtensible: TypeError of targetResult", false);
220 bool JSProxy::PreventExtensions(JSThread *thread, const JSHandle<JSProxy> &proxy)
222 STACK_LIMIT_CHECK(thread, false);
223 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
236 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::PreventExtensions: handler is null", false);
239 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget());
241 JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler), name));
243 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
246 return JSTaggedValue::PreventExtensions(thread, targetHandle);
248 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler());
250 EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, trap, handlerTag, undefined, 1);
251 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
254 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
257 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
262 if (booleanTrapResult && targetHandle->IsExtensible(thread)) {
263 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::PreventExtensions: targetIsExtensible is true", false);
270 bool JSProxy::GetOwnProperty(JSThread *thread, const JSHandle<JSProxy> &proxy, const JSHandle<JSTaggedValue> &key,
273 STACK_LIMIT_CHECK(thread, false);
274 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
290 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetOwnProperty: handler is null", false);
293 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget());
295 JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler), name));
297 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
300 return JSTaggedValue::GetOwnProperty(thread, targetHandle, key, desc);
302 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler());
305 EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, trap, handlerTag, undefined, argsLength);
306 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
309 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
311 JSHandle<JSTaggedValue> resultHandle(thread, trapResultObj);
315 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetOwnProperty: TypeError of trapResultObj", false);
318 PropertyDescriptor targetDesc(thread);
319 bool found = JSTaggedValue::GetOwnProperty(thread, targetHandle, key, targetDesc);
321 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
331 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetOwnProperty: targetDesc.[[Configurable]] is false", false);
337 if (!targetHandle->IsExtensible(thread)) {
338 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetOwnProperty: extensibleTarget is false", false);
347 JSObject::ToPropertyDescriptor(thread, resultHandle, resultDesc);
349 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
351 PropertyDescriptor::CompletePropertyDescriptor(thread, resultDesc);
353 bool valid = JSObject::IsCompatiblePropertyDescriptor(targetHandle->IsExtensible(thread), resultDesc, targetDesc);
355 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetOwnProperty: TypeError of valid", false);
361 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetOwnProperty: TypeError of targetDesc configurable", false);
366 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetOwnProperty: TypeError of targetDesc writable", false);
374 bool JSProxy::DefineOwnProperty(JSThread *thread, const JSHandle<JSProxy> &proxy, const JSHandle<JSTaggedValue> &key,
377 STACK_LIMIT_CHECK(thread, false);
378 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
383 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DefineOwnProperty: handler is Null", false);
386 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget());
388 JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler), name));
390 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
392 return JSTaggedValue::DefineOwnProperty(thread, targetHandle, key, desc);
396 JSHandle<JSTaggedValue> descObj = JSObject::FromPropertyDescriptor(thread, desc);
397 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler());
400 EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, trap, handlerTag, undefined, argsLength);
401 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
404 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
407 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
412 PropertyDescriptor targetDesc(thread);
413 bool found = JSTaggedValue::GetOwnProperty(thread, targetHandle, key, targetDesc);
415 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
429 if (!targetHandle->IsExtensible(thread)) {
430 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DefineOwnProperty: extensibleTarget is false", false);
434 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DefineOwnProperty: settingConfigFalse is true", false);
439 if (!JSObject::IsCompatiblePropertyDescriptor(targetHandle->IsExtensible(thread), desc, targetDesc)) {
440 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DefineOwnProperty: CompatiblePropertyDescriptor err", false);
444 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DefineOwnProperty: TypeError of settingConfigFalse", false);
450 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DefineOwnProperty: TypeError of DataDescriptor", false);
458 bool JSProxy::HasProperty(JSThread *thread, const JSHandle<JSProxy> &proxy, const JSHandle<JSTaggedValue> &key)
460 STACK_LIMIT_CHECK(thread, false);
461 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
466 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::HasProperty: handler is Null", false);
469 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget());
471 JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler), name));
473 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
475 return JSTaggedValue::HasProperty(thread, targetHandle, key);
479 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler());
483 EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, trap, handlerTag, undefined, argsLength);
484 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
487 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
490 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
495 PropertyDescriptor targetDesc(thread);
496 bool found = JSTaggedValue::GetOwnProperty(thread, targetHandle, key, targetDesc);
498 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
503 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::HasProperty: TypeError of targetDesc", false);
508 if (!targetHandle->IsExtensible(thread)) {
509 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::HasProperty: extensibleTarget is false", false);
517 OperationResult JSProxy::GetProperty(JSThread *thread, const JSHandle<JSProxy> &proxy,
520 STACK_LIMIT_CHECK(thread, OperationResult(thread, JSTaggedValue::Exception(), PropertyMetaData(false)));
521 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
525 JSHandle<JSTaggedValue> exceptionHandle(thread, JSTaggedValue::Exception());
527 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetProperty: handler is Null",
528 OperationResult(thread, exceptionHandle.GetTaggedValue(), PropertyMetaData(false)));
531 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget());
533 JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler), name));
536 thread, OperationResult(thread, exceptionHandle.GetTaggedValue(), PropertyMetaData(false)));
539 return JSTaggedValue::GetProperty(thread, targetHandle, key, receiver);
542 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler());
545 EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, trap, handlerTag, undefined, argsLength);
547 thread, OperationResult(thread, exceptionHandle.GetTaggedValue(), PropertyMetaData(false)));
550 JSHandle<JSTaggedValue> resultHandle(thread, trapResult);
554 thread, OperationResult(thread, exceptionHandle.GetTaggedValue(), PropertyMetaData(false)));
557 PropertyDescriptor targetDesc(thread);
558 bool found = JSTaggedValue::GetOwnProperty(thread, targetHandle, key, targetDesc);
561 thread, OperationResult(thread, exceptionHandle.GetTaggedValue(), PropertyMetaData(false)));
571 thread, "JSProxy::GetProperty: TypeError of trapResult",
572 OperationResult(thread, exceptionHandle.GetTaggedValue(), PropertyMetaData(false)));
582 thread, "JSProxy::GetProperty: trapResult is not undefined",
583 OperationResult(thread, exceptionHandle.GetTaggedValue(), PropertyMetaData(false)));
588 return OperationResult(thread, resultHandle.GetTaggedValue(), PropertyMetaData(true));
592 bool JSProxy::SetProperty(JSThread *thread, const JSHandle<JSProxy> &proxy, const JSHandle<JSTaggedValue> &key,
595 STACK_LIMIT_CHECK(thread, false);
596 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
601 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::SetProperty: handler is Null", false);
604 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget());
606 JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler), name));
608 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
610 return JSTaggedValue::SetProperty(thread, targetHandle, key, value, receiver, mayThrow);
614 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler());
617 EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, trap, handlerTag, undefined, argsLength);
618 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
622 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
625 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
628 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::SetProperty: 'set' return false", false);
633 PropertyDescriptor targetDesc(thread);
634 bool found = JSTaggedValue::GetOwnProperty(thread, targetHandle, key, targetDesc);
642 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::SetProperty: TypeError of trapResult", false);
649 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::SetProperty: TypeError of AccessorDescriptor", false);
656 bool JSProxy::DeleteProperty(JSThread *thread, const JSHandle<JSProxy> &proxy, const JSHandle<JSTaggedValue> &key)
658 STACK_LIMIT_CHECK(thread, false);
659 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
664 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DeleteProperty: handler is Null", false);
667 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget());
669 JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler), name));
671 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
673 return JSTaggedValue::DeleteProperty(thread, targetHandle, key);
677 JSHandle<JSTaggedValue> newTgt(thread, JSTaggedValue::Undefined());
678 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler());
681 EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, trap, handlerTag, undefined, argsLength);
682 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
685 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
688 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
693 PropertyDescriptor targetDesc(thread);
694 bool found = JSTaggedValue::GetOwnProperty(thread, targetHandle, key, targetDesc);
701 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DeleteProperty: targetDesc is not Configurable", false);
703 if (!targetHandle->IsExtensible(thread)) {
704 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DeleteProperty: targetHandle is not Extensible", false);
711 JSHandle<TaggedArray> JSProxy::OwnPropertyKeys(JSThread *thread, const JSHandle<JSProxy> &proxy)
713 STACK_LIMIT_CHECK(thread, JSHandle<TaggedArray>(thread, JSTaggedValue::Exception()));
714 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
718 THROW_TYPE_ERROR_AND_RETURN(thread, "OwnPropertyKeys: handler is null",
719 JSHandle<TaggedArray>(thread, JSTaggedValue::Exception()));
723 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget());
727 JSHandle<JSTaggedValue> handlerHandle(thread, handler);
728 JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, handlerHandle, key));
731 RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread);
736 return JSTaggedValue::GetOwnPropertyKeys(thread, targetHandle);
742 EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, trap, handlerHandle, undefined, 1);
743 RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread);
746 RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread);
747 JSHandle<JSTaggedValue> trapResArr(thread, res);
753 JSObject::CreateListFromArrayLike<ElementTypes::STRING_AND_SYMBOL>(thread, trapResArr));
754 RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread);
757 THROW_TYPE_ERROR_AND_RETURN(thread, "OwnPropertyKeys: contains duplicate entries",
758 JSHandle<TaggedArray>(thread, JSTaggedValue::Exception()));
762 bool extensibleTarget = targetHandle->IsExtensible(thread);
765 RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread);
768 JSHandle<TaggedArray> targetKeys = JSTaggedValue::GetOwnPropertyKeys(thread, targetHandle);
771 RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread);
784 JSHandle<TaggedArray> tgtCfigKeys = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(length);
785 JSHandle<TaggedArray> tgtNoCfigKeys = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(length);
790 JSHandle<JSTaggedValue> targetKey(thread, targetKeys->Get(i));
793 PropertyDescriptor desc(thread);
794 JSTaggedValue::GetOwnProperty(thread, targetHandle, targetKey, desc);
795 RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread);
798 tgtNoCfigKeys->Set(thread, noCfigLength, targetKey);
801 tgtCfigKeys->Set(thread, cfigLength, targetKey);
814 thread->GetEcmaVM()->GetFactory()->CopyArray(trapRes, trapRes->GetLength(), trapRes->GetLength());
823 THROW_TYPE_ERROR_AND_RETURN(thread, "OwnPropertyKeys: key is not an element of uncheckedResultKeys",
824 JSHandle<TaggedArray>(thread, JSTaggedValue::Exception()));
826 uncheckFesKeys->Set(thread, idx, JSTaggedValue::Hole());
841 THROW_TYPE_ERROR_AND_RETURN(thread, "OwnPropertyKeys: key is not an element of uncheckedResultKeys",
842 JSHandle<TaggedArray>(thread, JSTaggedValue::Exception()));
844 uncheckFesKeys->Set(thread, idx, JSTaggedValue::Hole());
850 THROW_TYPE_ERROR_AND_RETURN(thread, "OwnPropertyKeys: uncheckedResultKeys is not empty",
851 JSHandle<TaggedArray>(thread, JSTaggedValue::Exception()));
858 JSHandle<TaggedArray> JSProxy::GetAllPropertyKeys(JSThread *thread, const JSHandle<JSProxy> &proxy, uint32_t filter)
860 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
864 THROW_TYPE_ERROR_AND_RETURN(thread, "OwnPropertyKeys: handler is null",
865 JSHandle<TaggedArray>(thread, JSTaggedValue::Exception()));
869 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget());
872 JSHandle<JSTaggedValue> handlerHandle(thread, handler);
873 JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, handlerHandle, key));
875 RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread);
878 return JSTaggedValue::GetAllPropertyKeys(thread, targetHandle, filter);
882 EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, trap, handlerHandle, undefined, 1);
883 RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread);
886 RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread);
887 JSHandle<JSTaggedValue> trapResArr(thread, res);
890 JSObject::CreateListFromArrayLike<ElementTypes::STRING_AND_SYMBOL>(thread, trapResArr));
891 JSHandle<TaggedArray> ownKeys = JSTaggedValue::GetOwnPropertyKeys(thread, targetHandle);
892 JSHandle<TaggedArray> reciveArray = JSTaggedValue::GetAllPropertyKeys(thread, targetHandle, filter);
899 JSHandle<TaggedArray> resArray = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(newArrayLength);
905 resArray->Set(thread, elementIndex, reciveArray->Get(index));
913 resArray->Set(thread, i, trapRes->Get(i));
918 resArray->Set(thread, trapResLength + j, reciveArray->Get(index));
931 JSThread *thread = info->GetThread();
932 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
935 JSHandle<JSTaggedValue> handler(thread, proxy->GetHandler());
937 THROW_TYPE_ERROR_AND_RETURN(thread, "Call: handler is null", JSTaggedValue::Exception());
940 JSHandle<JSTaggedValue> target(thread, proxy->GetTarget());
944 JSHandle<JSTaggedValue> method = JSObject::GetMethod(thread, handler, key);
947 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
955 EcmaInterpreter::NewRuntimeCallInfo(thread, target, thisArg, undefined, argc);
956 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
961 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
964 taggedArray->Set(thread, index, info->GetCallArg(index));
966 JSHandle<JSArray> arrHandle = JSArray::CreateArrayFromList(thread, taggedArray);
971 EcmaInterpreter::NewRuntimeCallInfo(thread, method, handler, undefined, argsLength);
972 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
983 JSThread *thread = info->GetThread();
985 if (thread->DoStackLimitCheck()) {
989 const GlobalEnvConstants *globalConst = thread->GlobalConstants();
992 JSHandle<JSTaggedValue> handler(thread, proxy->GetHandler());
994 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor: handler is null", JSTaggedValue::Exception());
997 JSHandle<JSTaggedValue> target(thread, proxy->GetTarget());
1001 JSHandle<JSTaggedValue> method = JSObject::GetMethod(thread, handler, key);
1004 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
1010 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor is false", JSTaggedValue::Exception());
1018 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
1022 taggedArray->Set(thread, index, info->GetCallArg(index));
1024 JSHandle<JSArray> arrHandle = JSArray::CreateArrayFromList(thread, taggedArray);
1027 JSHandle<JSTaggedValue> newTarget(thread, info->GetNewTargetValue());
1034 thread->SetCurrentSPFrame(prevSp);
1037 EcmaInterpreter::NewRuntimeCallInfo(thread, method, handler, undefined, argsLength);
1038 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
1043 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread);
1046 THROW_TYPE_ERROR_AND_RETURN(thread, "new object is not object", JSTaggedValue::Exception());
1052 bool JSProxy::IsArray(JSThread *thread) const
1055 if (thread->DoStackLimitCheck()) {
1059 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::IsArray: handler is null", false);
1061 return GetTarget().IsArray(thread);
1064 JSHandle<JSTaggedValue> JSProxy::GetSourceTarget(JSThread *thread) const
1066 JSMutableHandle<JSProxy> proxy(thread, JSTaggedValue(this));
1067 JSMutableHandle<JSTaggedValue> target(thread, proxy->GetTarget());