• Home
  • Raw
  • Download

Lines Matching full:thread

47         TestHelper::CreateEcmaVMWithScope(instance, thread, scope);  in SetUp()
57 JSThread *thread {nullptr}; member in panda::test::JSProxyTest
60 static JSFunction *JSObjectTestCreate(JSThread *thread) in JSObjectTestCreate() argument
62 EcmaVM *ecmaVM = thread->GetEcmaVM(); in JSObjectTestCreate()
69 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
71thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>::Cast(dynclass), … in HWTEST_F_L0()
73 JSHandle<JSTaggedValue> key(thread->GetEcmaVM()->GetFactory()->NewFromCanBeCompressString("x")); in HWTEST_F_L0()
74 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
75 JSObject::SetProperty(thread, targetHandle, key, value); in HWTEST_F_L0()
76 EXPECT_EQ(JSObject::GetProperty(thread, targetHandle, key).GetValue()->GetInt(), 1); in HWTEST_F_L0()
79thread->GetEcmaVM()->GetFactory()->NewJSObjectByConstructor(JSHandle<JSFunction>::Cast(dynclass), … in HWTEST_F_L0()
82 JSHandle<JSProxy> proxyHandle = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
85 EXPECT_EQ(JSProxy::GetProperty(thread, proxyHandle, key).GetValue()->GetInt(), 1); in HWTEST_F_L0()
86 PropertyDescriptor desc(thread); in HWTEST_F_L0()
87 JSProxy::GetOwnProperty(thread, proxyHandle, key, desc); in HWTEST_F_L0()
100 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
102 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
107 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
108 JSObject::SetProperty(thread, targetHandle, key, value); in HWTEST_F_L0()
109 EXPECT_EQ(JSObject::GetProperty(thread, targetHandle, key).GetValue()->GetInt(), 1); in HWTEST_F_L0()
114 JSHandle<JSProxy> proxyHandle = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
117 EXPECT_EQ(JSProxy::GetProperty(thread, proxyHandle, key).GetValue()->GetInt(), 1); in HWTEST_F_L0()
120 EcmaVM *vm = thread->GetEcmaVM(); in HWTEST_F_L0()
122 JSHandle<JSTaggedValue> getKey = thread->GlobalConstants()->GetHandledGetString(); in HWTEST_F_L0()
124 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(handlerHandle), getKey, getHandle); in HWTEST_F_L0()
126 JSHandle<JSProxy> proxyHandle2(JSProxy::ProxyCreate(thread, targetHandle, handlerHandle)); in HWTEST_F_L0()
129 EXPECT_EQ(JSProxy::GetProperty(thread, proxyHandle2, key2).GetValue()->GetInt(), 10); in HWTEST_F_L0()
141 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
143 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
148 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
149 JSObject::SetProperty(thread, targetHandle, key, value); in HWTEST_F_L0()
150 EXPECT_EQ(JSObject::GetProperty(thread, targetHandle, key).GetValue()->GetInt(), 1); in HWTEST_F_L0()
155 JSHandle<JSProxy> proxyHandle = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
158 PropertyDescriptor desc(thread); in HWTEST_F_L0()
159 JSProxy::GetOwnProperty(thread, proxyHandle, key, desc); in HWTEST_F_L0()
163 EcmaVM *vm = thread->GetEcmaVM(); in HWTEST_F_L0()
165 …JSHandle<JSTaggedValue> defineKey = thread->GlobalConstants()->GetHandledGetOwnPropertyDescriptorS… in HWTEST_F_L0()
167 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(handlerHandle), defineKey, defineHandle); in HWTEST_F_L0()
169 JSHandle<JSProxy> proxyHandle2 = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
172 PropertyDescriptor desc2(thread); in HWTEST_F_L0()
173 EXPECT_FALSE(JSProxy::GetOwnProperty(thread, proxyHandle2, key2, desc2)); in HWTEST_F_L0()
185 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
187 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
192 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
197 JSHandle<JSProxy> proxyHandle = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
200 EXPECT_TRUE(JSProxy::SetProperty(thread, proxyHandle, key, value)); in HWTEST_F_L0()
201 EXPECT_EQ(JSProxy::GetProperty(thread, proxyHandle, key).GetValue()->GetInt(), 1); in HWTEST_F_L0()
202 EXPECT_EQ(JSObject::GetProperty(thread, targetHandle, key).GetValue()->GetInt(), 1); in HWTEST_F_L0()
205 EcmaVM *vm = thread->GetEcmaVM(); in HWTEST_F_L0()
207 JSHandle<JSTaggedValue> setKey = thread->GlobalConstants()->GetHandledSetString(); in HWTEST_F_L0()
209 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(handlerHandle), setKey, setHandle); in HWTEST_F_L0()
211 JSHandle<JSProxy> proxyHandle2(JSProxy::ProxyCreate(thread, targetHandle, handlerHandle)); in HWTEST_F_L0()
213 JSHandle<JSTaggedValue> value2(thread, JSTaggedValue(10)); in HWTEST_F_L0()
214 EXPECT_FALSE(JSProxy::SetProperty(thread, proxyHandle2, key, value2)); in HWTEST_F_L0()
215 EXPECT_EQ(JSProxy::GetProperty(thread, proxyHandle2, key).GetValue()->GetInt(), 1); in HWTEST_F_L0()
226 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
228 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
233 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
238 JSHandle<JSProxy> proxyHandle = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
241 PropertyDescriptor desc(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue(1))); in HWTEST_F_L0()
242 EXPECT_TRUE(JSProxy::DefineOwnProperty(thread, proxyHandle, key, desc)); in HWTEST_F_L0()
243 EXPECT_EQ(JSProxy::GetProperty(thread, proxyHandle, key).GetValue()->GetInt(), 1); in HWTEST_F_L0()
244 EXPECT_EQ(JSObject::GetProperty(thread, targetHandle, key).GetValue()->GetInt(), 1); in HWTEST_F_L0()
247 EcmaVM *vm = thread->GetEcmaVM(); in HWTEST_F_L0()
249 JSHandle<JSTaggedValue> setKey = thread->GlobalConstants()->GetHandledDefinePropertyString(); in HWTEST_F_L0()
251 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(handlerHandle), setKey, setHandle); in HWTEST_F_L0()
253 JSHandle<JSProxy> proxyHandle2 = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
255 PropertyDescriptor desc2(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue(10))); in HWTEST_F_L0()
256 EXPECT_FALSE(JSProxy::DefineOwnProperty(thread, proxyHandle, key, desc2)); in HWTEST_F_L0()
257 EXPECT_EQ(JSProxy::GetProperty(thread, proxyHandle2, key).GetValue()->GetInt(), 1); in HWTEST_F_L0()
268 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
270 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
275 JSHandle<JSTaggedValue> value(thread, JSTaggedValue(1)); in HWTEST_F_L0()
280 JSHandle<JSProxy> proxyHandle = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
283 …PropertyDescriptor desc(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue(1)), true, true, tru… in HWTEST_F_L0()
284 EXPECT_TRUE(JSProxy::DefineOwnProperty(thread, proxyHandle, key, desc)); in HWTEST_F_L0()
285 EXPECT_EQ(JSProxy::GetProperty(thread, proxyHandle, key).GetValue()->GetInt(), 1); in HWTEST_F_L0()
286 EXPECT_EQ(JSObject::GetProperty(thread, targetHandle, key).GetValue()->GetInt(), 1); in HWTEST_F_L0()
287 EXPECT_TRUE(JSProxy::DeleteProperty(thread, proxyHandle, key)); in HWTEST_F_L0()
288 PropertyDescriptor resDesc(thread); in HWTEST_F_L0()
289 JSProxy::GetOwnProperty(thread, proxyHandle, key, resDesc); in HWTEST_F_L0()
293 EcmaVM *vm = thread->GetEcmaVM(); in HWTEST_F_L0()
295 JSHandle<JSTaggedValue> funcKey = thread->GlobalConstants()->GetHandledDeletePropertyString(); in HWTEST_F_L0()
297 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(handlerHandle), funcKey, funcHandle); in HWTEST_F_L0()
299 JSHandle<JSProxy> proxyHandle2 = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
301 …PropertyDescriptor desc2(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue(1)), true, true, tr… in HWTEST_F_L0()
302 EXPECT_TRUE(JSProxy::DefineOwnProperty(thread, proxyHandle2, key, desc2)); in HWTEST_F_L0()
303 EXPECT_EQ(JSProxy::GetProperty(thread, proxyHandle2, key).GetValue()->GetInt(), 1); in HWTEST_F_L0()
304 EXPECT_FALSE(JSProxy::DeleteProperty(thread, proxyHandle2, key)); in HWTEST_F_L0()
315 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
317 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
321 JSObject::SetPrototype(thread, JSHandle<JSObject>(targetHandle), proto); in HWTEST_F_L0()
323 …JSTaggedValue::SameValue(JSHandle<JSObject>(targetHandle)->GetPrototype(thread), proto.GetTaggedVa… in HWTEST_F_L0()
328 JSHandle<JSProxy> proxyHandle = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
331 …EXPECT_TRUE(JSTaggedValue::SameValue(JSProxy::GetPrototype(thread, proxyHandle), proto.GetTaggedVa… in HWTEST_F_L0()
334 EcmaVM *vm = thread->GetEcmaVM(); in HWTEST_F_L0()
336 JSHandle<JSTaggedValue> funcKey = thread->GlobalConstants()->GetHandledGetPrototypeOfString(); in HWTEST_F_L0()
338 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(handlerHandle), funcKey, funcHandle); in HWTEST_F_L0()
340 JSHandle<JSProxy> proxyHandle2 = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
342 …EXPECT_TRUE(JSTaggedValue::SameValue(JSProxy::GetPrototype(thread, proxyHandle2), JSTaggedValue::N… in HWTEST_F_L0()
353 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
355 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
363 JSHandle<JSProxy> proxyHandle = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
366 JSProxy::SetPrototype(thread, proxyHandle, proto); in HWTEST_F_L0()
368 …JSTaggedValue::SameValue(JSHandle<JSObject>(targetHandle)->GetPrototype(thread), proto.GetTaggedVa… in HWTEST_F_L0()
371 EcmaVM *vm = thread->GetEcmaVM(); in HWTEST_F_L0()
373 JSHandle<JSTaggedValue> funcKey = thread->GlobalConstants()->GetHandledSetPrototypeOfString(); in HWTEST_F_L0()
375 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(handlerHandle), funcKey, funcHandle); in HWTEST_F_L0()
377 JSHandle<JSProxy> proxyHandle2 = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
379 EXPECT_FALSE(JSProxy::SetPrototype(thread, proxyHandle2, proto)); in HWTEST_F_L0()
390 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
392 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
399 JSHandle<JSProxy> proxyHandle = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
402 bool status1 = JSProxy::IsExtensible(thread, proxyHandle); in HWTEST_F_L0()
407 EcmaVM *vm = thread->GetEcmaVM(); in HWTEST_F_L0()
409 JSHandle<JSTaggedValue> funcKey = thread->GlobalConstants()->GetHandledIsExtensibleString(); in HWTEST_F_L0()
411 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(handlerHandle), funcKey, funcHandle); in HWTEST_F_L0()
413 JSHandle<JSProxy> proxyHandle2 = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
415 EXPECT_FALSE(JSProxy::IsExtensible(thread, proxyHandle2)); in HWTEST_F_L0()
426 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
428 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
435 JSHandle<JSProxy> proxyHandle = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
438 bool status1 = JSProxy::PreventExtensions(thread, proxyHandle); in HWTEST_F_L0()
444 EcmaVM *vm = thread->GetEcmaVM(); in HWTEST_F_L0()
446 … JSHandle<JSTaggedValue> funcKey = thread->GlobalConstants()->GetHandledPreventExtensionsString(); in HWTEST_F_L0()
449 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(handlerHandle), funcKey, funcHandle); in HWTEST_F_L0()
451 JSHandle<JSProxy> proxyHandle2 = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
453 EXPECT_FALSE(JSProxy::PreventExtensions(thread, proxyHandle2)); in HWTEST_F_L0()
464 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
466 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
471 PropertyDescriptor desc(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue(1))); in HWTEST_F_L0()
472 JSObject::DefineOwnProperty(thread, JSHandle<JSObject>::Cast(targetHandle), key, desc); in HWTEST_F_L0()
477 JSHandle<JSProxy> proxyHandle = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
480 EXPECT_TRUE(JSProxy::HasProperty(thread, proxyHandle, key)); in HWTEST_F_L0()
483 EcmaVM *vm = thread->GetEcmaVM(); in HWTEST_F_L0()
485 JSHandle<JSTaggedValue> funcKey = thread->GlobalConstants()->GetHandledHasString(); in HWTEST_F_L0()
487 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(handlerHandle), funcKey, funcHandle); in HWTEST_F_L0()
489 JSHandle<JSProxy> proxyHandle2 = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
491 EXPECT_FALSE(JSProxy::HasProperty(thread, proxyHandle2, key)); in HWTEST_F_L0()
496 auto thread = argv->GetThread(); in HandlerOwnPropertyKeys() local
497 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HandlerOwnPropertyKeys()
505 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
507 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
512 PropertyDescriptor desc(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue(1))); in HWTEST_F_L0()
513 JSObject::DefineOwnProperty(thread, JSHandle<JSObject>::Cast(targetHandle), key, desc); in HWTEST_F_L0()
518 JSHandle<JSProxy> proxyHandle = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
520 JSHandle<TaggedArray> res = JSProxy::OwnPropertyKeys(thread, proxyHandle); in HWTEST_F_L0()
525 EcmaVM *vm = thread->GetEcmaVM(); in HWTEST_F_L0()
527 JSHandle<JSTaggedValue> funcKey = thread->GlobalConstants()->GetHandledOwnKeysString(); in HWTEST_F_L0()
529 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(handlerHandle), funcKey, funcHandle); in HWTEST_F_L0()
531 JSHandle<JSProxy> proxyHandle2 = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
533 JSHandle<TaggedArray> res2 = JSProxy::OwnPropertyKeys(thread, proxyHandle2); in HWTEST_F_L0()
549 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
550 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in HWTEST_F_L0()
552 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
559 JSHandle<JSProxy> proxyHandle = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
562 …JSProxy::CallInternal(thread, proxyHandle, JSHandle<JSTaggedValue>::Cast(proxyHandle), 0, nullptr); in HWTEST_F_L0()
563 JSHandle<JSTaggedValue> taggedRes(thread, res); in HWTEST_F_L0()
568 JSHandle<JSTaggedValue> funcKey = thread->GlobalConstants()->GetHandledApplyString(); in HWTEST_F_L0()
570 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(handlerHandle), funcKey, funcHandle); in HWTEST_F_L0()
572 JSHandle<JSProxy> proxyHandle2 = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
575 …JSProxy::CallInternal(thread, proxyHandle2, JSHandle<JSTaggedValue>::Cast(proxyHandle2), 0, nullpt… in HWTEST_F_L0()
576 JSHandle<JSTaggedValue> taggedRes2(thread, res2); in HWTEST_F_L0()
583 auto thread = argv->GetThread(); in HandlerConstruct() local
584 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HandlerConstruct()
585 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HandlerConstruct()
589 …PropertyDescriptor desc(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue(2))); // 2 : test ca… in HandlerConstruct()
595 auto thread = argv->GetThread(); in HandlerConFunc() local
596 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HandlerConFunc()
597 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HandlerConFunc()
601 PropertyDescriptor desc(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue(1))); in HandlerConFunc()
609 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in HWTEST_F_L0()
610 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in HWTEST_F_L0()
612 JSHandle<JSTaggedValue> dynclass(thread, JSObjectTestCreate(thread)); in HWTEST_F_L0()
620 JSHandle<JSProxy> proxyHandle = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
622 JSTaggedValue res = JSProxy::ConstructInternal(thread, proxyHandle, 0, nullptr, targetHandle); in HWTEST_F_L0()
623 JSHandle<JSTaggedValue> taggedRes(thread, res); in HWTEST_F_L0()
625 EXPECT_EQ(JSObject::GetProperty(thread, taggedRes, key).GetValue()->GetInt(), 1); in HWTEST_F_L0()
628 JSHandle<JSTaggedValue> funcKey = thread->GlobalConstants()->GetHandledProxyConstructString(); in HWTEST_F_L0()
630 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(handlerHandle), funcKey, funcHandle); in HWTEST_F_L0()
632 JSHandle<JSProxy> proxyHandle2 = JSProxy::ProxyCreate(thread, targetHandle, handlerHandle); in HWTEST_F_L0()
634 JSTaggedValue res2 = JSProxy::ConstructInternal(thread, proxyHandle2, 0, nullptr, targetHandle); in HWTEST_F_L0()
635 JSHandle<JSTaggedValue> taggedRes2(thread, res2); in HWTEST_F_L0()
636 EXPECT_EQ(JSObject::GetProperty(thread, taggedRes2, key).GetValue()->GetInt(), 2); in HWTEST_F_L0()