• Home
  • Raw
  • Download

Lines Matching full:thread

26 JSHandle<JSProxy> JSProxy::ProxyCreate(JSThread *thread, const JSHandle<JSTaggedValue> &target,  in ProxyCreate()  argument
31 THROW_TYPE_ERROR_AND_RETURN(thread, "ProxyCreate: target is not Object", in ProxyCreate()
32 JSHandle<JSProxy>(thread, JSTaggedValue::Exception())); in ProxyCreate()
37 THROW_TYPE_ERROR_AND_RETURN(thread, "ProxyCreate: handler is not Object", in ProxyCreate()
38 JSHandle<JSProxy>(thread, JSTaggedValue::Exception())); in ProxyCreate()
45 return thread->GetEcmaVM()->GetFactory()->NewJSProxy(target, handler); in ProxyCreate()
49 JSTaggedValue JSProxy::GetPrototype(JSThread *thread, const JSHandle<JSProxy> &proxy) in GetPrototype() argument
52 JSHandle<JSTaggedValue> handler(thread, proxy->GetHandler()); in GetPrototype()
55 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetPrototype: handler is null", JSTaggedValue::Excep… in GetPrototype()
60 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget()); in GetPrototype()
62 JSHandle<JSTaggedValue> name(thread->GlobalConstants()->GetHandledGetPrototypeOfString()); in GetPrototype()
63 JSHandle<JSTaggedValue> trap = JSObject::GetMethod(thread, handler, name); in GetPrototype()
65 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GetPrototype()
69 return JSHandle<JSObject>(targetHandle)->GetPrototype(thread); in GetPrototype()
72 InternalCallParams *arguments = thread->GetInternalCallParams(); in GetPrototype()
74 JSTaggedValue handlerProto = JSFunction::Call(thread, trap, handler, 1, arguments->GetArgv()); in GetPrototype()
77 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GetPrototype()
80 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetPrototype: Type(handlerProto) is neither Object n… in GetPrototype()
86 if (targetHandle->IsExtensible(thread)) { in GetPrototype()
89 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GetPrototype()
92 JSTaggedValue targetProto = JSHandle<JSObject>(targetHandle)->GetPrototype(thread); in GetPrototype()
94 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in GetPrototype()
97 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetPrototype: SameValue(handlerProto, targetProto) i… in GetPrototype()
105 bool JSProxy::SetPrototype(JSThread *thread, const JSHandle<JSProxy> &proxy, const JSHandle<JSTagge… in SetPrototype() argument
113 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::SetPrototype: handler is null", false); in SetPrototype()
118 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget()); in SetPrototype()
120 JSHandle<JSTaggedValue> name = thread->GlobalConstants()->GetHandledSetPrototypeOfString(); in SetPrototype()
121 …JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler),… in SetPrototype()
123 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in SetPrototype()
127 return JSTaggedValue::SetPrototype(thread, targetHandle, proto); in SetPrototype()
129 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler()); in SetPrototype()
130 InternalCallParams *arguments = thread->GetInternalCallParams(); in SetPrototype()
133 JSFunction::Call(thread, trap, handlerTag, 2, arguments->GetArgv()); // 2: target and proto in SetPrototype()
145 if (targetHandle->IsExtensible(thread)) { in SetPrototype()
148 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in SetPrototype()
151 JSTaggedValue targetProto = JSHandle<JSObject>(targetHandle)->GetPrototype(thread); in SetPrototype()
153 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in SetPrototype()
157 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::SetPrototype: TypeError of targetProto and Result", … in SetPrototype()
164 bool JSProxy::IsExtensible(JSThread *thread, const JSHandle<JSProxy> &proxy) in IsExtensible() argument
170 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::IsExtensible: handler is null", false); in IsExtensible()
175 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget()); in IsExtensible()
177 JSHandle<JSTaggedValue> name = thread->GlobalConstants()->GetHandledIsExtensibleString(); in IsExtensible()
178 …JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler),… in IsExtensible()
180 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in IsExtensible()
184 return targetHandle->IsExtensible(thread); in IsExtensible()
187 JSHandle<JSTaggedValue> newTgt(thread, JSTaggedValue::Undefined()); in IsExtensible()
188 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler()); in IsExtensible()
189 InternalCallParams *arguments = thread->GetInternalCallParams(); in IsExtensible()
191 JSTaggedValue trapResult = JSFunction::Call(thread, trap, handlerTag, 1, arguments->GetArgv()); in IsExtensible()
195 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in IsExtensible()
201 if (targetHandle->IsExtensible(thread) != booleanTrapResult) { in IsExtensible()
202 … THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::IsExtensible: TypeError of targetResult", false); in IsExtensible()
209 bool JSProxy::PreventExtensions(JSThread *thread, const JSHandle<JSProxy> &proxy) in PreventExtensions() argument
223 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::PreventExtensions: handler is null", false); in PreventExtensions()
226 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget()); in PreventExtensions()
227 JSHandle<JSTaggedValue> name = thread->GlobalConstants()->GetHandledPreventExtensionsString(); in PreventExtensions()
228 …JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler),… in PreventExtensions()
230 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in PreventExtensions()
233 return JSTaggedValue::PreventExtensions(thread, targetHandle); in PreventExtensions()
235 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler()); in PreventExtensions()
236 InternalCallParams *arguments = thread->GetInternalCallParams(); in PreventExtensions()
238 JSTaggedValue trapResult = JSFunction::Call(thread, trap, handlerTag, 1, arguments->GetArgv()); in PreventExtensions()
242 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in PreventExtensions()
247 if (booleanTrapResult && targetHandle->IsExtensible(thread)) { in PreventExtensions()
248 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::PreventExtensions: targetIsExtensible is true", fals… in PreventExtensions()
255 bool JSProxy::GetOwnProperty(JSThread *thread, const JSHandle<JSProxy> &proxy, const JSHandle<JSTag… in GetOwnProperty() argument
273 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetOwnProperty: handler is null", false); in GetOwnProperty()
276 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget()); in GetOwnProperty()
277 …JSHandle<JSTaggedValue> name = thread->GlobalConstants()->GetHandledGetOwnPropertyDescriptorString… in GetOwnProperty()
278 …JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler),… in GetOwnProperty()
280 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in GetOwnProperty()
283 return JSTaggedValue::GetOwnProperty(thread, targetHandle, key, desc); in GetOwnProperty()
285 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler()); in GetOwnProperty()
286 InternalCallParams *arguments = thread->GetInternalCallParams(); in GetOwnProperty()
289 JSFunction::Call(thread, trap, handlerTag, 2, arguments->GetArgv()); // 2: target and key in GetOwnProperty()
291 JSHandle<JSTaggedValue> resultHandle(thread, trapResultObj); in GetOwnProperty()
295 … THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetOwnProperty: TypeError of trapResultObj", false); in GetOwnProperty()
298 PropertyDescriptor targetDesc(thread); in GetOwnProperty()
299 bool found = JSTaggedValue::GetOwnProperty(thread, targetHandle, key, targetDesc); in GetOwnProperty()
301 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in GetOwnProperty()
311 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetOwnProperty: targetDesc.[[Configurable]] is false… in GetOwnProperty()
317 if (!targetHandle->IsExtensible(thread)) { in GetOwnProperty()
318 … THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetOwnProperty: extensibleTarget is false", false); in GetOwnProperty()
327 JSObject::ToPropertyDescriptor(thread, resultHandle, resultDesc); in GetOwnProperty()
329 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in GetOwnProperty()
331 PropertyDescriptor::CompletePropertyDescriptor(thread, resultDesc); in GetOwnProperty()
333 …bool valid = JSObject::IsCompatiblePropertyDescriptor(targetHandle->IsExtensible(thread), resultDe… in GetOwnProperty()
335 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetOwnProperty: TypeError of valid", false); in GetOwnProperty()
341 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetOwnProperty: TypeError of targetDesc configurable… in GetOwnProperty()
346 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetOwnProperty: TypeError of targetDesc writable", f… in GetOwnProperty()
351 THROW_TYPE_ERROR_AND_RETURN(thread, "", false); in GetOwnProperty()
359 bool JSProxy::DefineOwnProperty(JSThread *thread, const JSHandle<JSProxy> &proxy, const JSHandle<JS… in DefineOwnProperty() argument
366 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DefineOwnProperty: handler is Null", false); in DefineOwnProperty()
369 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget()); in DefineOwnProperty()
370 JSHandle<JSTaggedValue> name = thread->GlobalConstants()->GetHandledDefinePropertyString(); in DefineOwnProperty()
371 …JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler),… in DefineOwnProperty()
373 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in DefineOwnProperty()
375 return JSTaggedValue::DefineOwnProperty(thread, targetHandle, key, desc); in DefineOwnProperty()
379 JSHandle<JSTaggedValue> descObj = JSObject::FromPropertyDescriptor(thread, desc); in DefineOwnProperty()
380 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler()); in DefineOwnProperty()
381 InternalCallParams *arguments = thread->GetInternalCallParams(); in DefineOwnProperty()
384 … JSFunction::Call(thread, trap, handlerTag, 3, arguments->GetArgv()); // 3: target, key and desc in DefineOwnProperty()
388 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in DefineOwnProperty()
393 PropertyDescriptor targetDesc(thread); in DefineOwnProperty()
394 bool found = JSTaggedValue::GetOwnProperty(thread, targetHandle, key, targetDesc); in DefineOwnProperty()
396 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in DefineOwnProperty()
410 if (!targetHandle->IsExtensible(thread)) { in DefineOwnProperty()
411 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DefineOwnProperty: extensibleTarget is false", false… in DefineOwnProperty()
415 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DefineOwnProperty: settingConfigFalse is true", fals… in DefineOwnProperty()
420 …if (!JSObject::IsCompatiblePropertyDescriptor(targetHandle->IsExtensible(thread), desc, targetDesc… in DefineOwnProperty()
421 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DefineOwnProperty: CompatiblePropertyDescriptor err"… in DefineOwnProperty()
425 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DefineOwnProperty: TypeError of settingConfigFalse",… in DefineOwnProperty()
431 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DefineOwnProperty: TypeError of DataDescriptor", fal… in DefineOwnProperty()
437 THROW_TYPE_ERROR_AND_RETURN(thread, "", false); in DefineOwnProperty()
445 bool JSProxy::HasProperty(JSThread *thread, const JSHandle<JSProxy> &proxy, const JSHandle<JSTagged… in HasProperty() argument
451 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::HasProperty: handler is Null", false); in HasProperty()
454 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget()); in HasProperty()
455 JSHandle<JSTaggedValue> name = thread->GlobalConstants()->GetHandledHasString(); in HasProperty()
456 …JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler),… in HasProperty()
458 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in HasProperty()
460 return JSTaggedValue::HasProperty(thread, targetHandle, key); in HasProperty()
464 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler()); in HasProperty()
466 InternalCallParams *arguments = thread->GetInternalCallParams(); in HasProperty()
469 JSFunction::Call(thread, trap, handlerTag, 2, arguments->GetArgv()); // 2: target and key in HasProperty()
473 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in HasProperty()
478 PropertyDescriptor targetDesc(thread); in HasProperty()
479 bool found = JSTaggedValue::GetOwnProperty(thread, targetHandle, key, targetDesc); in HasProperty()
481 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in HasProperty()
486 … THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::HasProperty: TypeError of targetDesc", false); in HasProperty()
491 if (!targetHandle->IsExtensible(thread)) { in HasProperty()
492 … THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::HasProperty: extensibleTarget is false", false); in HasProperty()
500 OperationResult JSProxy::GetProperty(JSThread *thread, const JSHandle<JSProxy> &proxy, in GetProperty() argument
506 JSHandle<JSTaggedValue> exceptionHandle(thread, JSTaggedValue::Exception()); in GetProperty()
508 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::GetProperty: handler is Null", in GetProperty()
509 … OperationResult(thread, exceptionHandle.GetTaggedValue(), PropertyMetaData(false))); in GetProperty()
512 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget()); in GetProperty()
513 JSHandle<JSTaggedValue> name = thread->GlobalConstants()->GetHandledGetString(); in GetProperty()
514 …JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler),… in GetProperty()
517 thread, OperationResult(thread, exceptionHandle.GetTaggedValue(), PropertyMetaData(false))); in GetProperty()
520 return JSTaggedValue::GetProperty(thread, targetHandle, key, receiver); in GetProperty()
523 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler()); in GetProperty()
524 InternalCallParams *arguments = thread->GetInternalCallParams(); in GetProperty()
527 … JSFunction::Call(thread, trap, handlerTag, 3, arguments->GetArgv()); // 3: «target, P, Receiver» in GetProperty()
528 JSHandle<JSTaggedValue> resultHandle(thread, trapResult); in GetProperty()
532 thread, OperationResult(thread, exceptionHandle.GetTaggedValue(), PropertyMetaData(false))); in GetProperty()
535 PropertyDescriptor targetDesc(thread); in GetProperty()
536 bool found = JSTaggedValue::GetOwnProperty(thread, targetHandle, key, targetDesc); in GetProperty()
539 thread, OperationResult(thread, exceptionHandle.GetTaggedValue(), PropertyMetaData(false))); in GetProperty()
549 thread, "JSProxy::GetProperty: TypeError of trapResult", in GetProperty()
550 … OperationResult(thread, exceptionHandle.GetTaggedValue(), PropertyMetaData(false))); in GetProperty()
560 thread, "JSProxy::GetProperty: trapResult is not undefined", in GetProperty()
561 … OperationResult(thread, exceptionHandle.GetTaggedValue(), PropertyMetaData(false))); in GetProperty()
566 return OperationResult(thread, resultHandle.GetTaggedValue(), PropertyMetaData(true)); in GetProperty()
570 bool JSProxy::SetProperty(JSThread *thread, const JSHandle<JSProxy> &proxy, const JSHandle<JSTagged… in SetProperty() argument
577 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::SetProperty: handler is Null", false); in SetProperty()
580 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget()); in SetProperty()
581 JSHandle<JSTaggedValue> name = thread->GlobalConstants()->GetHandledSetString(); in SetProperty()
582 …JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler),… in SetProperty()
584 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in SetProperty()
586 return JSTaggedValue::SetProperty(thread, targetHandle, key, value, receiver, mayThrow); in SetProperty()
590 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler()); in SetProperty()
591 InternalCallParams *arguments = thread->GetInternalCallParams(); in SetProperty()
594 …JSFunction::Call(thread, trap, handlerTag, 4, arguments->GetArgv()); // 4: «target, P, V, Receive… in SetProperty()
598 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in SetProperty()
603 PropertyDescriptor targetDesc(thread); in SetProperty()
604 bool found = JSTaggedValue::GetOwnProperty(thread, targetHandle, key, targetDesc); in SetProperty()
612 … THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::SetProperty: TypeError of trapResult", false); in SetProperty()
619 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::SetProperty: TypeError of AccessorDescriptor", false… in SetProperty()
626 bool JSProxy::DeleteProperty(JSThread *thread, const JSHandle<JSProxy> &proxy, const JSHandle<JSTag… in DeleteProperty() argument
632 THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DeleteProperty: handler is Null", false); in DeleteProperty()
635 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget()); in DeleteProperty()
636 JSHandle<JSTaggedValue> name = thread->GlobalConstants()->GetHandledDeletePropertyString(); in DeleteProperty()
637 …JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, JSHandle<JSTaggedValue>(thread, handler),… in DeleteProperty()
639 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in DeleteProperty()
641 return JSTaggedValue::DeleteProperty(thread, targetHandle, key); in DeleteProperty()
645 JSHandle<JSTaggedValue> newTgt(thread, JSTaggedValue::Undefined()); in DeleteProperty()
646 JSHandle<JSTaggedValue> handlerTag(thread, proxy->GetHandler()); in DeleteProperty()
647 InternalCallParams *arguments = thread->GetInternalCallParams(); in DeleteProperty()
650 JSFunction::Call(thread, trap, handlerTag, 2, arguments->GetArgv()); // 2: target and key in DeleteProperty()
654 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false); in DeleteProperty()
659 PropertyDescriptor targetDesc(thread); in DeleteProperty()
660 bool found = JSTaggedValue::GetOwnProperty(thread, targetHandle, key, targetDesc); in DeleteProperty()
667 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DeleteProperty: targetDesc is not Configurable", fal… in DeleteProperty()
669 if (!targetHandle->IsExtensible(thread)) { in DeleteProperty()
670 …THROW_TYPE_ERROR_AND_RETURN(thread, "JSProxy::DeleteProperty: targetHandle is not Extensible", fal… in DeleteProperty()
672 if (!targetHandle->IsExtensible(thread)) { in DeleteProperty()
673 THROW_TYPE_ERROR_AND_RETURN(thread, "", false); in DeleteProperty()
680 JSHandle<TaggedArray> JSProxy::OwnPropertyKeys(JSThread *thread, const JSHandle<JSProxy> &proxy) in OwnPropertyKeys() argument
685 THROW_TYPE_ERROR_AND_RETURN(thread, "OwnPropertyKeys: handler is null", in OwnPropertyKeys()
686 JSHandle<TaggedArray>(thread, JSTaggedValue::Exception())); in OwnPropertyKeys()
690 JSHandle<JSTaggedValue> targetHandle(thread, proxy->GetTarget()); in OwnPropertyKeys()
693 JSHandle<JSTaggedValue> key = thread->GlobalConstants()->GetHandledOwnKeysString(); in OwnPropertyKeys()
694 JSHandle<JSTaggedValue> handlerHandle(thread, handler); in OwnPropertyKeys()
695 JSHandle<JSTaggedValue> trap(JSObject::GetMethod(thread, handlerHandle, key)); in OwnPropertyKeys()
698 RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread); in OwnPropertyKeys()
703 return JSTaggedValue::GetOwnPropertyKeys(thread, targetHandle); in OwnPropertyKeys()
708 InternalCallParams *arguments = thread->GetInternalCallParams(); in OwnPropertyKeys()
710 JSTaggedValue res = JSFunction::Call(thread, trap, handlerHandle, 1, arguments->GetArgv()); in OwnPropertyKeys()
711 JSHandle<JSTaggedValue> trap_res_arr(thread, res); in OwnPropertyKeys()
717 JSObject::CreateListFromArrayLike<ElementTypes::STRING_AND_SYMBOL>(thread, trap_res_arr)); in OwnPropertyKeys()
718 RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread); in OwnPropertyKeys()
721 THROW_TYPE_ERROR_AND_RETURN(thread, "OwnPropertyKeys: contains duplicate entries", in OwnPropertyKeys()
722 JSHandle<TaggedArray>(thread, JSTaggedValue::Exception())); in OwnPropertyKeys()
726 bool extensibleTarget = targetHandle->IsExtensible(thread); in OwnPropertyKeys()
729 RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread); in OwnPropertyKeys()
732 JSHandle<TaggedArray> targetKeys = JSTaggedValue::GetOwnPropertyKeys(thread, targetHandle); in OwnPropertyKeys()
735 RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread); in OwnPropertyKeys()
748 JSHandle<TaggedArray> tgtCfigKeys = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(length); in OwnPropertyKeys()
749 JSHandle<TaggedArray> tgtNoCfigKeys = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(length); in OwnPropertyKeys()
754 JSHandle<JSTaggedValue> targetKey(thread, targetKeys->Get(i)); in OwnPropertyKeys()
757 PropertyDescriptor desc(thread); in OwnPropertyKeys()
758 JSTaggedValue::GetOwnProperty(thread, targetHandle, targetKey, desc); in OwnPropertyKeys()
759 RETURN_HANDLE_IF_ABRUPT_COMPLETION(TaggedArray, thread); in OwnPropertyKeys()
762 tgtNoCfigKeys->Set(thread, noCfigLength, targetKey); in OwnPropertyKeys()
765 tgtCfigKeys->Set(thread, cfigLength, targetKey); in OwnPropertyKeys()
778thread->GetEcmaVM()->GetFactory()->CopyArray(trapRes, trapRes->GetLength(), trapRes->GetLength()); in OwnPropertyKeys()
787 …THROW_TYPE_ERROR_AND_RETURN(thread, "OwnPropertyKeys: key is not an element of uncheckedResultKeys… in OwnPropertyKeys()
788 JSHandle<TaggedArray>(thread, JSTaggedValue::Exception())); in OwnPropertyKeys()
790 uncheckFesKeys->Set(thread, idx, JSTaggedValue::Hole()); in OwnPropertyKeys()
805 …THROW_TYPE_ERROR_AND_RETURN(thread, "OwnPropertyKeys: key is not an element of uncheckedResultKeys… in OwnPropertyKeys()
806 JSHandle<TaggedArray>(thread, JSTaggedValue::Exception())); in OwnPropertyKeys()
808 uncheckFesKeys->Set(thread, idx, JSTaggedValue::Hole()); in OwnPropertyKeys()
814 THROW_TYPE_ERROR_AND_RETURN(thread, "OwnPropertyKeys: uncheckedResultKeys is not empty", in OwnPropertyKeys()
815 JSHandle<TaggedArray>(thread, JSTaggedValue::Exception())); in OwnPropertyKeys()
823 JSTaggedValue JSProxy::CallInternal(JSThread *thread, const JSHandle<JSProxy> &proxy, in CallInternal() argument
828 JSHandle<JSTaggedValue> handler(thread, proxy->GetHandler()); in CallInternal()
830 THROW_TYPE_ERROR_AND_RETURN(thread, "Call: handler is null", JSTaggedValue::Exception()); in CallInternal()
833 JSHandle<JSTaggedValue> target(thread, proxy->GetTarget()); in CallInternal()
836 JSHandle<JSTaggedValue> key(thread->GlobalConstants()->GetHandledApplyString()); in CallInternal()
837 JSHandle<JSTaggedValue> method = JSObject::GetMethod(thread, handler, key); in CallInternal()
840 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CallInternal()
844 return JSFunction::Call(thread, target, thisArg, argc, argv); in CallInternal()
847 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in CallInternal()
850 taggedArray->Set(thread, index, JSTaggedValue(argv[index])); in CallInternal()
852 JSHandle<JSArray> arrHandle = JSArray::CreateArrayFromList(thread, taggedArray); in CallInternal()
855 InternalCallParams *proxyArgv = thread->GetInternalCallParams(); in CallInternal()
857 …return JSFunction::Call(thread, method, handler, 3, proxyArgv->GetArgv()); // 3: «target, thisArg… in CallInternal()
861 JSTaggedValue JSProxy::ConstructInternal(JSThread *thread, const JSHandle<JSProxy> &proxy, uint32_t… in ConstructInternal() argument
865 JSHandle<JSTaggedValue> handler(thread, proxy->GetHandler()); in ConstructInternal()
867 … THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor: handler is null", JSTaggedValue::Exception()); in ConstructInternal()
870 JSHandle<JSTaggedValue> target(thread, proxy->GetTarget()); in ConstructInternal()
873 JSHandle<JSTaggedValue> key(thread->GlobalConstants()->GetHandledProxyConstructString()); in ConstructInternal()
874 JSHandle<JSTaggedValue> method = JSObject::GetMethod(thread, handler, key); in ConstructInternal()
877 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ConstructInternal()
883 return JSFunction::Construct(thread, target, argc, argv, newTarget); in ConstructInternal()
887 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in ConstructInternal()
890 taggedArray->Set(thread, index, JSTaggedValue(argv[index])); in ConstructInternal()
892 JSHandle<JSArray> arrHandle = JSArray::CreateArrayFromList(thread, taggedArray); in ConstructInternal()
895 InternalCallParams *arguments = thread->GetInternalCallParams(); in ConstructInternal()
898 …JSFunction::Call(thread, method, handler, 3, arguments->GetArgv()); // 3: «target, argArray, newT… in ConstructInternal()
900 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ConstructInternal()
903 THROW_TYPE_ERROR_AND_RETURN(thread, "new object is not object", JSTaggedValue::Exception()); in ConstructInternal()
909 bool JSProxy::IsArray(JSThread *thread) const in IsArray()
912 THROW_TYPE_ERROR_AND_RETURN(thread, "", false); in IsArray()
914 return GetTarget().IsArray(thread); in IsArray()
917 JSHandle<JSTaggedValue> JSProxy::GetSourceTarget(JSThread *thread) const in GetSourceTarget()
919 JSMutableHandle<JSProxy> proxy(thread, JSTaggedValue(this)); in GetSourceTarget()
920 JSMutableHandle<JSTaggedValue> target(thread, proxy->GetTarget()); in GetSourceTarget()