Lines Matching full:local

65 using ::v8::Local;
97 v8::Local<v8::String> profile_name = v8_str("my_profile1"); in RunWithProfiler()
107 static Local<Value> signature_expected_receiver;
120 v8::Local<v8::Array> result = in IncrementingSignatureCallback()
155 Local<Context> local_env; in THREADED_TEST()
158 local_env = env.local(); in THREADED_TEST()
161 // Local context should still be live. in THREADED_TEST()
165 v8::Local<v8::Primitive> undef = v8::Undefined(CcTest::isolate()); in THREADED_TEST()
170 Local<Script> script = v8_compile(source); in THREADED_TEST()
179 v8::Local<Context> env = Context::New(CcTest::isolate()); in THREADED_TEST()
192 static void TestSignature(const char* loop_js, Local<Value> receiver, in TestSignature()
224 v8::Local<v8::FunctionTemplate> fun = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
225 v8::Local<v8::Signature> sig = v8::Signature::New(isolate, fun); in THREADED_TEST()
226 v8::Local<v8::FunctionTemplate> callback_sig = v8::FunctionTemplate::New( in THREADED_TEST()
227 isolate, IncrementingSignatureCallback, Local<Value>(), sig); in THREADED_TEST()
228 v8::Local<v8::FunctionTemplate> callback = in THREADED_TEST()
230 v8::Local<v8::FunctionTemplate> sub_fun = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
232 v8::Local<v8::FunctionTemplate> unrel_fun = in THREADED_TEST()
235 v8::Local<v8::ObjectTemplate> fun_proto = fun->PrototypeTemplate(); in THREADED_TEST()
242 Local<Value> fun_instance = in THREADED_TEST()
243 fun->InstanceTemplate()->NewInstance(env.local()).ToLocalChecked(); in THREADED_TEST()
244 Local<Value> sub_fun_instance = in THREADED_TEST()
245 sub_fun->InstanceTemplate()->NewInstance(env.local()).ToLocalChecked(); in THREADED_TEST()
248 ->Set(env.local(), v8_str("Fun"), in THREADED_TEST()
249 fun->GetFunction(env.local()).ToLocalChecked()) in THREADED_TEST()
252 ->Set(env.local(), v8_str("UnrelFun"), in THREADED_TEST()
253 unrel_fun->GetFunction(env.local()).ToLocalChecked()) in THREADED_TEST()
256 ->Set(env.local(), v8_str("fun_instance"), fun_instance) in THREADED_TEST()
259 ->Set(env.local(), v8_str("sub_fun_instance"), sub_fun_instance) in THREADED_TEST()
289 Local<Value> test_object = CompileRun(source.start()); in THREADED_TEST()
295 if (i >= bad_signature_start_offset) test_object = Local<Value>(); in THREADED_TEST()
309 v8::Local<v8::Primitive> undef = v8::Undefined(isolate); in THREADED_TEST()
310 Local<String> undef_str = undef->ToString(env.local()).ToLocalChecked(); in THREADED_TEST()
322 Local<v8::Object> obj = v8::Object::New(isolate); in THREADED_TEST()
323 Local<Value> foo_before = in THREADED_TEST()
324 obj->Get(env.local(), v8_str("foo")).ToLocalChecked(); in THREADED_TEST()
326 Local<String> bar_str = v8_str("bar"); in THREADED_TEST()
327 CHECK(obj->Set(env.local(), v8_str("foo"), bar_str).FromJust()); in THREADED_TEST()
328 Local<Value> foo_after = in THREADED_TEST()
329 obj->Get(env.local(), v8_str("foo")).ToLocalChecked(); in THREADED_TEST()
332 CHECK(bar_str->Equals(env.local(), foo_after).FromJust()); in THREADED_TEST()
339 Local<v8::Object> obj = v8::Object::New(env->GetIsolate()); in THREADED_TEST()
340 Local<Value> before = obj->Get(env.local(), 1).ToLocalChecked(); in THREADED_TEST()
342 Local<String> bar_str = v8_str("bar"); in THREADED_TEST()
343 CHECK(obj->Set(env.local(), 1, bar_str).FromJust()); in THREADED_TEST()
344 Local<Value> after = obj->Get(env.local(), 1).ToLocalChecked(); in THREADED_TEST()
347 CHECK(bar_str->Equals(env.local(), after).FromJust()); in THREADED_TEST()
349 Local<v8::Array> value = CompileRun("[\"a\", \"b\"]").As<v8::Array>(); in THREADED_TEST()
351 ->Equals(env.local(), value->Get(env.local(), 0).ToLocalChecked()) in THREADED_TEST()
354 ->Equals(env.local(), value->Get(env.local(), 1).ToLocalChecked()) in THREADED_TEST()
363 Local<Script> script = v8_compile(source); in THREADED_TEST()
435 Local<String> source = in THREADED_TEST()
438 Local<Script> script = v8_compile(source); in THREADED_TEST()
439 Local<Value> value = script->Run(env.local()).ToLocalChecked(); in THREADED_TEST()
441 CHECK_EQ(7, value->Int32Value(env.local()).FromJust()); in THREADED_TEST()
466 Local<String> source = in THREADED_TEST()
476 Local<Script> script = v8_compile(source); in THREADED_TEST()
477 Local<Value> value = script->Run(env.local()).ToLocalChecked(); in THREADED_TEST()
479 CHECK_EQ(7, value->Int32Value(env.local()).FromJust()); in THREADED_TEST()
495 Local<String> source = in THREADED_TEST()
510 Local<Script> script = v8_compile(source); in THREADED_TEST()
511 Local<Value> value = script->Run(env.local()).ToLocalChecked(); in THREADED_TEST()
513 CHECK_EQ(7, value->Int32Value(env.local()).FromJust()); in THREADED_TEST()
529 Local<String> source = v8_str(c_source); in THREADED_TEST()
536 Local<Script> script = v8_compile(source); in THREADED_TEST()
537 Local<Value> value = script->Run(env.local()).ToLocalChecked(); in THREADED_TEST()
539 CHECK_EQ(7, value->Int32Value(env.local()).FromJust()); in THREADED_TEST()
558 Local<String> small_string = in TEST()
584 Local<String> large_string = in TEST()
603 Local<String> small_string = v8_str("s1"); in TEST()
616 Local<String> large_string = v8_str(buf); in TEST()
630 Local<String> cons = Local<String>::Cast(CompileRun( in TEST()
633 Local<String> slice = Local<String>::Cast(CompileRun( in TEST()
662 Local<String> string = in THREADED_TEST()
684 Local<String> string = in THREADED_TEST()
759 Local<String> string = in THREADED_TEST()
783 Local<String> string = in THREADED_TEST()
831 Local<String> source = in TEST()
834 Local<Script> script = v8_compile(source); in TEST()
835 Local<Value> value = script->Run(env.local()).ToLocalChecked(); in TEST()
837 CHECK_EQ(7, value->Int32Value(env.local()).FromJust()); in TEST()
854 Local<String> source = in TEST()
857 Local<Script> script = v8_compile(source); in TEST()
858 Local<Value> value = script->Run(env.local()).ToLocalChecked(); in TEST()
860 CHECK_EQ(7, value->Int32Value(env.local()).FromJust()); in TEST()
882 Local<String> left = v8_str(one_byte_string_1); in THREADED_TEST()
885 Local<String> right = in THREADED_TEST()
891 Local<String> source = String::Concat(left, right); in THREADED_TEST()
917 Local<Script> script = v8_compile(source); in THREADED_TEST()
918 Local<Value> value = script->Run(env.local()).ToLocalChecked(); in THREADED_TEST()
920 CHECK_EQ(68, value->Int32Value(env.local()).FromJust()); in THREADED_TEST()
931 v8::Local<v8::Object> global = env->Global(); in THREADED_TEST()
932 CHECK(global->Set(env.local(), v8_str("pi"), v8_num(3.1415926)).FromJust()); in THREADED_TEST()
933 Local<Value> pi = global->Get(env.local(), v8_str("pi")).ToLocalChecked(); in THREADED_TEST()
934 CHECK_EQ(3.1415926, pi->NumberValue(env.local()).FromJust()); in THREADED_TEST()
974 Local<String> name, const v8::PropertyCallbackInfo<Value>& info) { in Return239Callback()
991 Local<v8::FunctionTemplate> fun_templ = in TestFunctionTemplateInitializer()
993 Local<Function> fun = fun_templ->GetFunction(env.local()).ToLocalChecked(); in TestFunctionTemplateInitializer()
994 CHECK(env->Global()->Set(env.local(), v8_str("obj"), fun).FromJust()); in TestFunctionTemplateInitializer()
995 Local<Script> script = v8_compile("obj()"); in TestFunctionTemplateInitializer()
1007 Local<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(isolate); in TestFunctionTemplateInitializer()
1009 Local<Function> fun = fun_templ->GetFunction(env.local()).ToLocalChecked(); in TestFunctionTemplateInitializer()
1010 CHECK(env->Global()->Set(env.local(), v8_str("obj"), fun).FromJust()); in TestFunctionTemplateInitializer()
1011 Local<Script> script = v8_compile("obj()"); in TestFunctionTemplateInitializer()
1025 Local<v8::FunctionTemplate> fun_templ = in TestFunctionTemplateAccessor()
1029 Local<Function> fun = fun_templ->GetFunction(env.local()).ToLocalChecked(); in TestFunctionTemplateAccessor()
1030 CHECK(env->Global()->Set(env.local(), v8_str("obj"), fun).FromJust()); in TestFunctionTemplateAccessor()
1031 Local<Value> result = in TestFunctionTemplateAccessor()
1032 v8_compile("(new obj()).toString()")->Run(env.local()).ToLocalChecked(); in TestFunctionTemplateAccessor()
1033 CHECK(v8_str("[object funky]")->Equals(env.local(), result).FromJust()); in TestFunctionTemplateAccessor()
1035 Local<Script> script; in TestFunctionTemplateAccessor()
1066 v8::Local<v8::ObjectTemplate> object_template = in TestSimpleCallback()
1070 v8::Local<v8::Object> object = in TestSimpleCallback()
1071 object_template->NewInstance(env.local()).ToLocalChecked(); in TestSimpleCallback()
1074 ->Set(env.local(), v8_str("callback_object"), object) in TestSimpleCallback()
1076 v8::Local<v8::Script> script; in TestSimpleCallback()
1164 v8::Local<v8::Object> object; in FastReturnValueCallback()
1172 Local<Value> TestFastReturnValues() { in TestFastReturnValues()
1176 v8::Local<v8::ObjectTemplate> object_template = in TestFastReturnValues()
1181 v8::Local<v8::Object> object = in TestFastReturnValues()
1182 object_template->NewInstance(env.local()).ToLocalChecked(); in TestFastReturnValues()
1185 ->Set(env.local(), v8_str("callback_object"), object) in TestFastReturnValues()
1195 v8::Local<v8::Value> value; in THREADED_PROFILED_TEST()
1209 value->Int32Value(env.local()).FromJust()); in THREADED_PROFILED_TEST()
1215 value->Uint32Value(env.local()).FromJust()); in THREADED_PROFILED_TEST()
1222 value->ToNumber(env.local()).ToLocalChecked()->Value()); in THREADED_PROFILED_TEST()
1229 value->ToBoolean(env.local()).ToLocalChecked()->Value()); in THREADED_PROFILED_TEST()
1268 Local<v8::FunctionTemplate> fun_templ = in THREADED_TEST()
1269 v8::FunctionTemplate::New(isolate, handle_callback, Local<v8::Value>(), in THREADED_TEST()
1270 Local<v8::Signature>(), 23); in THREADED_TEST()
1271 Local<Function> fun = fun_templ->GetFunction(env.local()).ToLocalChecked(); in THREADED_TEST()
1272 CHECK(env->Global()->Set(env.local(), v8_str("obj"), fun).FromJust()); in THREADED_TEST()
1273 Local<Script> script = v8_compile("obj.length"); in THREADED_TEST()
1277 Local<v8::FunctionTemplate> fun_templ = in THREADED_TEST()
1280 Local<Function> fun = fun_templ->GetFunction(env.local()).ToLocalChecked(); in THREADED_TEST()
1281 CHECK(env->Global()->Set(env.local(), v8_str("obj"), fun).FromJust()); in THREADED_TEST()
1282 Local<Script> script = v8_compile("obj.length"); in THREADED_TEST()
1287 Local<v8::FunctionTemplate> fun_templ = in THREADED_TEST()
1289 Local<Function> fun = fun_templ->GetFunction(env.local()).ToLocalChecked(); in THREADED_TEST()
1290 CHECK(env->Global()->Set(env.local(), v8_str("obj"), fun).FromJust()); in THREADED_TEST()
1291 Local<Script> script = v8_compile("obj.length"); in THREADED_TEST()
1310 v8::Local<v8::Value> data = v8::External::New(isolate, expected_ptr); in TestExternalPointerWrapping()
1312 v8::Local<v8::Object> obj = v8::Object::New(isolate); in TestExternalPointerWrapping()
1313 CHECK(obj->Set(env.local(), v8_str("func"), in TestExternalPointerWrapping()
1315 ->GetFunction(env.local()) in TestExternalPointerWrapping()
1318 CHECK(env->Global()->Set(env.local(), v8_str("obj"), obj).FromJust()); in TestExternalPointerWrapping()
1324 ->BooleanValue(env.local()) in TestExternalPointerWrapping()
1380 Local<v8::FunctionTemplate> base = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
1381 Local<v8::FunctionTemplate> derived = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
1382 Local<v8::FunctionTemplate> other = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
1385 Local<v8::Function> base_function = in THREADED_TEST()
1386 base->GetFunction(env.local()).ToLocalChecked(); in THREADED_TEST()
1387 Local<v8::Function> derived_function = in THREADED_TEST()
1388 derived->GetFunction(env.local()).ToLocalChecked(); in THREADED_TEST()
1389 Local<v8::Function> other_function = in THREADED_TEST()
1390 other->GetFunction(env.local()).ToLocalChecked(); in THREADED_TEST()
1392 Local<v8::Object> base_instance = in THREADED_TEST()
1393 base_function->NewInstance(env.local()).ToLocalChecked(); in THREADED_TEST()
1394 Local<v8::Object> derived_instance = in THREADED_TEST()
1395 derived_function->NewInstance(env.local()).ToLocalChecked(); in THREADED_TEST()
1396 Local<v8::Object> derived_instance2 = in THREADED_TEST()
1397 derived_function->NewInstance(env.local()).ToLocalChecked(); in THREADED_TEST()
1398 Local<v8::Object> other_instance = in THREADED_TEST()
1399 other_function->NewInstance(env.local()).ToLocalChecked(); in THREADED_TEST()
1401 derived_instance2->Set(env.local(), v8_str("__proto__"), derived_instance) in THREADED_TEST()
1403 CHECK(other_instance->Set(env.local(), v8_str("__proto__"), derived_instance2) in THREADED_TEST()
1407 CHECK(base_instance->Equals(env.local(), in THREADED_TEST()
1414 CHECK(derived_instance->Equals(env.local(), in THREADED_TEST()
1418 CHECK(derived_instance->Equals(env.local(), in THREADED_TEST()
1430 env.local(), in THREADED_TEST()
1433 CHECK(derived_instance2->Equals(env.local(), in THREADED_TEST()
1438 env.local(), in THREADED_TEST()
1450 Local<v8::Integer> value_obj = v8::Integer::New(isolate, value); in THREADED_TEST()
1469 Local<v8::Integer> value_obj = v8::Integer::New(isolate, value); in THREADED_TEST()
1492 Local<v8::Integer> value_obj = v8::Integer::New(isolate, value); in THREADED_TEST()
1508 Local<v8::Integer> value_obj = v8::Integer::NewFromUnsigned(isolate, value); in THREADED_TEST()
1525 Local<v8::Integer> value_obj = v8::Integer::NewFromUnsigned(isolate, value); in THREADED_TEST()
1542 Local<v8::Integer> value_obj = v8::Integer::NewFromUnsigned(isolate, value); in THREADED_TEST()
1559 Local<v8::Integer> value_obj = v8::Integer::NewFromUnsigned(isolate, value); in THREADED_TEST()
1570 v8::Local<Value> syntax_error = CompileRun( in THREADED_TEST()
1573 v8::Local<Value> not_error = CompileRun("{a:42}"); in THREADED_TEST()
1575 v8::Local<Value> not_object = CompileRun("42"); in THREADED_TEST()
1585 v8::Local<Value> gen = CompileRun("gen"); in THREADED_TEST()
1586 v8::Local<Value> genObj = CompileRun("gen()"); in THREADED_TEST()
1587 v8::Local<Value> object = CompileRun("{a:42}"); in THREADED_TEST()
1588 v8::Local<Value> func = CompileRun("func"); in THREADED_TEST()
1611 v8::Local<Value> arguments_object = in THREADED_TEST()
1614 v8::Local<Value> array = CompileRun("[1,2,3]"); in THREADED_TEST()
1616 v8::Local<Value> object = CompileRun("{a:42}"); in THREADED_TEST()
1624 v8::Local<Value> map = CompileRun("new Map()"); in THREADED_TEST()
1625 v8::Local<Value> set = CompileRun("new Set()"); in THREADED_TEST()
1626 v8::Local<Value> weak_map = CompileRun("new WeakMap()"); in THREADED_TEST()
1627 v8::Local<Value> weak_set = CompileRun("new WeakSet()"); in THREADED_TEST()
1649 v8::Local<Value> object = CompileRun("{a:42}"); in THREADED_TEST()
1660 v8::Local<Value> boxed_string = CompileRun("new String(\"test\")"); in THREADED_TEST()
1662 v8::Local<Value> unboxed_string = CompileRun("\"test\""); in THREADED_TEST()
1664 v8::Local<Value> boxed_not_string = CompileRun("new Number(42)"); in THREADED_TEST()
1666 v8::Local<Value> not_object = CompileRun("0"); in THREADED_TEST()
1668 v8::Local<v8::StringObject> as_boxed = boxed_string.As<v8::StringObject>(); in THREADED_TEST()
1670 Local<v8::String> the_string = as_boxed->ValueOf(); in THREADED_TEST()
1673 v8::Local<v8::Value> new_boxed_string = v8::StringObject::New(the_string); in THREADED_TEST()
1685 v8::Local<Value> boxed_string = CompileRun("new String(\"test\")"); in TEST()
1687 v8::Local<v8::Object> str_obj = boxed_string.As<v8::Object>(); in TEST()
1688 CHECK(!str_obj->Delete(context.local(), 2).FromJust()); in TEST()
1689 CHECK(!str_obj->Delete(context.local(), v8_num(2)).FromJust()); in TEST()
1696 v8::Local<Value> boxed_number = CompileRun("new Number(42)"); in THREADED_TEST()
1698 v8::Local<Value> unboxed_number = CompileRun("42"); in THREADED_TEST()
1700 v8::Local<Value> boxed_not_number = CompileRun("new Boolean(false)"); in THREADED_TEST()
1702 v8::Local<v8::NumberObject> as_boxed = boxed_number.As<v8::NumberObject>(); in THREADED_TEST()
1706 v8::Local<v8::Value> new_boxed_number = in THREADED_TEST()
1718 v8::Local<Value> boxed_boolean = CompileRun("new Boolean(true)"); in THREADED_TEST()
1720 v8::Local<Value> unboxed_boolean = CompileRun("true"); in THREADED_TEST()
1722 v8::Local<Value> boxed_not_boolean = CompileRun("new Number(42)"); in THREADED_TEST()
1724 v8::Local<v8::BooleanObject> as_boxed = boxed_boolean.As<v8::BooleanObject>(); in THREADED_TEST()
1728 v8::Local<v8::Value> boxed_true = in THREADED_TEST()
1730 v8::Local<v8::Value> boxed_false = in THREADED_TEST()
1745 Local<Value> primitive_false = Boolean::New(env->GetIsolate(), false); in THREADED_TEST()
1748 CHECK(!primitive_false->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
1752 Local<Value> false_value = BooleanObject::New(env->GetIsolate(), false); in THREADED_TEST()
1755 CHECK(false_value->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
1759 Local<BooleanObject> false_boolean_object = false_value.As<BooleanObject>(); in THREADED_TEST()
1762 CHECK(false_boolean_object->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
1767 Local<Value> primitive_true = Boolean::New(env->GetIsolate(), true); in THREADED_TEST()
1770 CHECK(primitive_true->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
1774 Local<Value> true_value = BooleanObject::New(env->GetIsolate(), true); in THREADED_TEST()
1777 CHECK(true_value->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
1781 Local<BooleanObject> true_boolean_object = true_value.As<BooleanObject>(); in THREADED_TEST()
1784 CHECK(true_boolean_object->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
1795 Local<v8::Number> pi_obj = v8::Number::New(env->GetIsolate(), PI); in THREADED_TEST()
1796 CHECK_EQ(PI, pi_obj->NumberValue(env.local()).FromJust()); in THREADED_TEST()
1804 Local<String> str = v8_str("3.1415926"); in THREADED_TEST()
1805 CHECK_EQ(3.1415926, str->NumberValue(env.local()).FromJust()); in THREADED_TEST()
1806 v8::Local<v8::Boolean> t = v8::True(isolate); in THREADED_TEST()
1807 CHECK_EQ(1.0, t->NumberValue(env.local()).FromJust()); in THREADED_TEST()
1808 v8::Local<v8::Boolean> f = v8::False(isolate); in THREADED_TEST()
1809 CHECK_EQ(0.0, f->NumberValue(env.local()).FromJust()); in THREADED_TEST()
1817 Local<Value> date = v8::Date::New(env.local(), PI).ToLocalChecked(); in THREADED_TEST()
1818 CHECK_EQ(3.0, date->NumberValue(env.local()).FromJust()); in THREADED_TEST()
1820 ->Set(env.local(), v8_str("property"), in THREADED_TEST()
1824 ->Get(env.local(), v8_str("property")) in THREADED_TEST()
1826 ->Int32Value(env.local()) in THREADED_TEST()
1835 v8::Local<v8::Boolean> t = v8::True(isolate); in THREADED_TEST()
1837 v8::Local<v8::Boolean> f = v8::False(isolate); in THREADED_TEST()
1839 v8::Local<v8::Primitive> u = v8::Undefined(isolate); in THREADED_TEST()
1840 CHECK(!u->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
1841 v8::Local<v8::Primitive> n = v8::Null(isolate); in THREADED_TEST()
1842 CHECK(!n->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
1843 v8::Local<String> str1 = v8_str(""); in THREADED_TEST()
1844 CHECK(!str1->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
1845 v8::Local<String> str2 = v8_str("x"); in THREADED_TEST()
1846 CHECK(str2->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
1847 CHECK(!v8::Number::New(isolate, 0)->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
1848 CHECK(v8::Number::New(isolate, -1)->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
1849 CHECK(v8::Number::New(isolate, 1)->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
1850 CHECK(v8::Number::New(isolate, 42)->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
1852 ->Run(env.local()) in THREADED_TEST()
1854 ->BooleanValue(env.local()) in THREADED_TEST()
1865 static void GetM(Local<String> name, in GetM()
1875 v8::Local<v8::FunctionTemplate> func_templ = in THREADED_TEST()
1879 v8::Local<ObjectTemplate> templ = func_templ->InstanceTemplate(); in THREADED_TEST()
1883 v8::Local<Script> script(v8_compile("dummy()")); in THREADED_TEST()
1884 v8::Local<Value> result(script->Run(env.local()).ToLocalChecked()); in THREADED_TEST()
1885 CHECK_EQ(13.4, result->NumberValue(env.local()).FromJust()); in THREADED_TEST()
1894 Local<v8::FunctionTemplate> fun = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
1895 v8::Local<v8::String> class_name = v8_str("the_class_name"); in THREADED_TEST()
1897 Local<ObjectTemplate> templ1 = ObjectTemplate::New(isolate, fun); in THREADED_TEST()
1901 Local<v8::Object> instance1 = in THREADED_TEST()
1902 templ1->NewInstance(env.local()).ToLocalChecked(); in THREADED_TEST()
1904 CHECK(env->Global()->Set(env.local(), v8_str("p"), instance1).FromJust()); in THREADED_TEST()
1906 ->Run(env.local()) in THREADED_TEST()
1908 ->BooleanValue(env.local()) in THREADED_TEST()
1911 ->Run(env.local()) in THREADED_TEST()
1913 ->BooleanValue(env.local()) in THREADED_TEST()
1915 Local<v8::FunctionTemplate> fun2 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
1917 Local<ObjectTemplate> templ2 = fun2->InstanceTemplate(); in THREADED_TEST()
1920 Local<v8::Object> instance2 = in THREADED_TEST()
1921 templ2->NewInstance(env.local()).ToLocalChecked(); in THREADED_TEST()
1922 CHECK(env->Global()->Set(env.local(), v8_str("q"), instance2).FromJust()); in THREADED_TEST()
1924 ->Run(env.local()) in THREADED_TEST()
1926 ->BooleanValue(env.local()) in THREADED_TEST()
1929 ->Run(env.local()) in THREADED_TEST()
1931 ->BooleanValue(env.local()) in THREADED_TEST()
1934 ->Run(env.local()) in THREADED_TEST()
1936 ->BooleanValue(env.local()) in THREADED_TEST()
1939 ->Run(env.local()) in THREADED_TEST()
1941 ->BooleanValue(env.local()) in THREADED_TEST()
1952 static void GetKnurd(Local<String> property, in GetKnurd()
1962 v8::Local<v8::FunctionTemplate> super = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
1970 v8::Local<v8::FunctionTemplate> base1 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
1974 v8::Local<v8::FunctionTemplate> base2 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
1981 ->Set(env.local(), v8_str("s"), in THREADED_TEST()
1982 super->GetFunction(env.local()).ToLocalChecked()) in THREADED_TEST()
1985 ->Set(env.local(), v8_str("base1"), in THREADED_TEST()
1986 base1->GetFunction(env.local()).ToLocalChecked()) in THREADED_TEST()
1989 ->Set(env.local(), v8_str("base2"), in THREADED_TEST()
1990 base2->GetFunction(env.local()).ToLocalChecked()) in THREADED_TEST()
1995 ->BooleanValue(env.local()) in THREADED_TEST()
1998 ->BooleanValue(env.local()) in THREADED_TEST()
2002 ->Run(env.local()) in THREADED_TEST()
2004 ->BooleanValue(env.local()) in THREADED_TEST()
2009 CompileRun("s.knurd == undefined")->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
2011 ->BooleanValue(env.local()) in THREADED_TEST()
2014 ->BooleanValue(env.local()) in THREADED_TEST()
2018 ->Set(env.local(), v8_str("obj"), base1->GetFunction(env.local()) in THREADED_TEST()
2020 ->NewInstance(env.local()) in THREADED_TEST()
2024 ->Run(env.local()) in THREADED_TEST()
2026 ->NumberValue(env.local()) in THREADED_TEST()
2029 ->Run(env.local()) in THREADED_TEST()
2031 ->BooleanValue(env.local()) in THREADED_TEST()
2034 ->Run(env.local()) in THREADED_TEST()
2036 ->NumberValue(env.local()) in THREADED_TEST()
2039 ->Run(env.local()) in THREADED_TEST()
2041 ->BooleanValue(env.local()) in THREADED_TEST()
2044 ->Run(env.local()) in THREADED_TEST()
2046 ->NumberValue(env.local()) in THREADED_TEST()
2050 ->Set(env.local(), v8_str("obj2"), base2->GetFunction(env.local()) in THREADED_TEST()
2052 ->NewInstance(env.local()) in THREADED_TEST()
2056 ->Run(env.local()) in THREADED_TEST()
2058 ->NumberValue(env.local()) in THREADED_TEST()
2061 ->Run(env.local()) in THREADED_TEST()
2063 ->BooleanValue(env.local()) in THREADED_TEST()
2066 ->Run(env.local()) in THREADED_TEST()
2068 ->NumberValue(env.local()) in THREADED_TEST()
2071 ->Run(env.local()) in THREADED_TEST()
2073 ->BooleanValue(env.local()) in THREADED_TEST()
2076 ->Run(env.local()) in THREADED_TEST()
2078 ->NumberValue(env.local()) in THREADED_TEST()
2082 CHECK(v8_compile("obj.v2")->Run(env.local()).ToLocalChecked()->IsUndefined()); in THREADED_TEST()
2084 v8_compile("obj2.v1")->Run(env.local()).ToLocalChecked()->IsUndefined()); in THREADED_TEST()
2090 void SimpleAccessorGetter(Local<String> name, in SimpleAccessorGetter()
2092 Local<Object> self = Local<Object>::Cast(info.This()); in SimpleAccessorGetter()
2098 void SimpleAccessorSetter(Local<String> name, Local<Value> value, in SimpleAccessorSetter()
2100 Local<Object> self = Local<Object>::Cast(info.This()); in SimpleAccessorSetter()
2106 void SymbolAccessorGetter(Local<Name> name, in SymbolAccessorGetter()
2109 Local<Symbol> sym = Local<Symbol>::Cast(name); in SymbolAccessorGetter()
2112 SimpleAccessorGetter(Local<String>::Cast(sym->Name()), info); in SymbolAccessorGetter()
2115 void SymbolAccessorSetter(Local<Name> name, Local<Value> value, in SymbolAccessorSetter()
2118 Local<Symbol> sym = Local<Symbol>::Cast(name); in SymbolAccessorSetter()
2121 SimpleAccessorSetter(Local<String>::Cast(sym->Name()), value, info); in SymbolAccessorSetter()
2125 Local<Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { in SymbolAccessorGetterReturnsDefault()
2127 Local<Symbol> sym = Local<Symbol>::Cast(name); in SymbolAccessorGetterReturnsDefault()
2133 Local<Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { in ThrowingSymbolAccessorGetter()
2142 v8::Local<v8::Value> res = CompileRun("var a = []; a;"); in THREADED_TEST()
2159 v8::Local<Value> result = CompileRun("this.propertyIsEnumerable(undefined)"); in THREADED_TEST()
2164 v8::Local<Script> call_recursively_script;
2171 v8::Local<v8::Context> context = args.GetIsolate()->GetCurrentContext(); in CallScriptRecursivelyCall()
2190 v8::Local<v8::Context> context = args.GetIsolate()->GetCurrentContext(); in CallFunctionRecursivelyCall()
2204 v8::Local<Value> function = in CallFunctionRecursivelyCall()
2217 v8::Local<v8::ObjectTemplate> global = ObjectTemplate::New(isolate); in THREADED_TEST()
2225 ->Set(env.local(), v8_str("depth"), v8::Integer::New(isolate, 0)) in THREADED_TEST()
2228 call_recursively_script->Run(env.local()).ToLocalChecked(); in THREADED_TEST()
2229 call_recursively_script = v8::Local<Script>(); in THREADED_TEST()
2232 ->Set(env.local(), v8_str("depth"), v8::Integer::New(isolate, 0)) in THREADED_TEST()
2239 Local<Name> key, const v8::PropertyCallbackInfo<v8::Value>& info) { in ThrowingPropertyHandlerGet()
2249 Local<Name> key, Local<Value>, in ThrowingPropertyHandlerSet()
2259 v8::Local<v8::ObjectTemplate> obj = ObjectTemplate::New(isolate); in THREADED_TEST()
2264 ->Set(env.local(), v8_str("obj"), in THREADED_TEST()
2265 obj->NewInstance(env.local()).ToLocalChecked()) in THREADED_TEST()
2267 v8::Local<Value> otto = in THREADED_TEST()
2269 CHECK(v8_str("otto")->Equals(env.local(), otto).FromJust()); in THREADED_TEST()
2270 v8::Local<Value> netto = in THREADED_TEST()
2272 CHECK(v8_str("netto")->Equals(env.local(), netto).FromJust()); in THREADED_TEST()
2279 Local<v8::FunctionTemplate> Foo = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
2283 ->Set(env.local(), v8_str("Foo"), in THREADED_TEST()
2284 Foo->GetFunction(env.local()).ToLocalChecked()) in THREADED_TEST()
2286 Local<Script> script = v8_compile("Foo.prototype.plak"); in THREADED_TEST()
2296 Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
2297 Local<v8::ObjectTemplate> instance_templ = templ->InstanceTemplate(); in THREADED_TEST()
2299 Local<v8::Object> obj = templ->GetFunction(env.local()) in THREADED_TEST()
2301 ->NewInstance(env.local()) in THREADED_TEST()
2306 CHECK_EQ(17, obj->GetInternalField(0)->Int32Value(env.local()).FromJust()); in THREADED_TEST()
2313 Local<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(isolate); in THREADED_TEST()
2316 v8::Local<v8::Object> global_proxy = env->Global(); in THREADED_TEST()
2317 v8::Local<v8::Object> global = global_proxy->GetPrototype().As<v8::Object>(); in THREADED_TEST()
2321 CHECK_EQ(17, global->GetInternalField(0)->Int32Value(env.local()).FromJust()); in THREADED_TEST()
2329 v8::Local<v8::Object> global = env->Global(); in THREADED_TEST()
2330 CHECK(global->Set(env.local(), 0, v8_str("value")).FromJust()); in THREADED_TEST()
2331 CHECK(global->HasRealIndexedProperty(env.local(), 0).FromJust()); in THREADED_TEST()
2335 static void CheckAlignedPointerInInternalField(Local<v8::Object> obj, in CheckAlignedPointerInInternalField()
2349 Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
2350 Local<v8::ObjectTemplate> instance_templ = templ->InstanceTemplate(); in THREADED_TEST()
2352 Local<v8::Object> obj = templ->GetFunction(env.local()) in THREADED_TEST()
2354 ->NewInstance(env.local()) in THREADED_TEST()
2418 v8::Local<Value> data) { in CheckEmbedderData()
2444 Local<v8::Object> obj = v8::Object::New(isolate); in THREADED_TEST()
2466 Local<v8::Object> o1 = v8::Object::New(isolate); in THREADED_TEST()
2467 Local<v8::Object> o2 = v8::Object::New(isolate); in THREADED_TEST()
2474 Local<v8::Object> o1 = v8::Object::New(isolate); in THREADED_TEST()
2475 Local<v8::Object> o2 = v8::Object::New(isolate); in THREADED_TEST()
2486 Local<Object> global_proxy = env->Global(); in GlobalProxyIdentityHash()
2489 ->Set(env.local(), v8_str("global"), global_proxy) in GlobalProxyIdentityHash()
2507 LocalContext env2(NULL, Local<ObjectTemplate>(), global_proxy); in GlobalProxyIdentityHash()
2526 Local<v8::Symbol> symbol = v8::Symbol::New(isolate); in TEST()
2536 v8::Local<v8::Symbol> js_symbol = in TEST()
2553 Local<v8::String> str = v8_str("str1"); in TEST()
2561 Local<v8::String> str2 = v8_str("str1"); in TEST()
2572 v8::Local<v8::Object> obj = v8::Object::New(isolate); in THREADED_TEST()
2573 v8::Local<v8::Symbol> sym1 = v8::Symbol::New(isolate); in THREADED_TEST()
2574 v8::Local<v8::Symbol> sym2 = v8::Symbol::New(isolate, v8_str("my-symbol")); in THREADED_TEST()
2575 v8::Local<v8::Symbol> sym3 = v8::Symbol::New(isolate, v8_str("sym3")); in THREADED_TEST()
2584 CHECK(sym1->Equals(env.local(), sym1).FromJust()); in THREADED_TEST()
2585 CHECK(sym2->Equals(env.local(), sym2).FromJust()); in THREADED_TEST()
2586 CHECK(!sym1->Equals(env.local(), sym2).FromJust()); in THREADED_TEST()
2587 CHECK(!sym2->Equals(env.local(), sym1).FromJust()); in THREADED_TEST()
2593 CHECK(sym2->Name()->Equals(env.local(), v8_str("my-symbol")).FromJust()); in THREADED_TEST()
2595 v8::Local<v8::Value> sym_val = sym2; in THREADED_TEST()
2597 CHECK(sym_val->Equals(env.local(), sym2).FromJust()); in THREADED_TEST()
2599 CHECK(v8::Symbol::Cast(*sym_val)->Equals(env.local(), sym2).FromJust()); in THREADED_TEST()
2601 v8::Local<v8::Value> sym_obj = v8::SymbolObject::New(isolate, sym2); in THREADED_TEST()
2605 CHECK(sym_obj->Equals(env.local(), sym2).FromJust()); in THREADED_TEST()
2608 ->Equals(env.local(), sym_obj) in THREADED_TEST()
2612 ->Equals(env.local(), sym2) in THREADED_TEST()
2616 CHECK(obj->Delete(env.local(), sym1).FromJust()); in THREADED_TEST()
2617 CHECK(!obj->Has(env.local(), sym1).FromJust()); in THREADED_TEST()
2620 obj->Set(env.local(), sym1, v8::Integer::New(isolate, 1503)).FromJust()); in THREADED_TEST()
2621 CHECK(obj->Has(env.local(), sym1).FromJust()); in THREADED_TEST()
2622 CHECK_EQ(1503, obj->Get(env.local(), sym1) in THREADED_TEST()
2624 ->Int32Value(env.local()) in THREADED_TEST()
2627 obj->Set(env.local(), sym1, v8::Integer::New(isolate, 2002)).FromJust()); in THREADED_TEST()
2628 CHECK(obj->Has(env.local(), sym1).FromJust()); in THREADED_TEST()
2629 CHECK_EQ(2002, obj->Get(env.local(), sym1) in THREADED_TEST()
2631 ->Int32Value(env.local()) in THREADED_TEST()
2633 CHECK_EQ(v8::None, obj->GetPropertyAttributes(env.local(), sym1).FromJust()); in THREADED_TEST()
2636 obj->GetOwnPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2638 obj->GetPropertyNames(env.local()).ToLocalChecked()->Length(); in THREADED_TEST()
2639 CHECK(obj->Set(env.local(), v8_str("bla"), v8::Integer::New(isolate, 20)) in THREADED_TEST()
2642 obj->GetOwnPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2644 obj->GetPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2648 CHECK(obj->SetAccessor(env.local(), sym3, SymbolAccessorGetter, in THREADED_TEST()
2651 CHECK(obj->Get(env.local(), sym3).ToLocalChecked()->IsUndefined()); in THREADED_TEST()
2652 CHECK(obj->Set(env.local(), sym3, v8::Integer::New(isolate, 42)).FromJust()); in THREADED_TEST()
2653 CHECK(obj->Get(env.local(), sym3) in THREADED_TEST()
2655 ->Equals(env.local(), v8::Integer::New(isolate, 42)) in THREADED_TEST()
2657 CHECK(obj->Get(env.local(), v8_str("accessor_sym3")) in THREADED_TEST()
2659 ->Equals(env.local(), v8::Integer::New(isolate, 42)) in THREADED_TEST()
2665 obj->Set(env.local(), sym2, v8::Integer::New(isolate, 2008)).FromJust()); in THREADED_TEST()
2666 CHECK_EQ(2002, obj->Get(env.local(), sym1) in THREADED_TEST()
2668 ->Int32Value(env.local()) in THREADED_TEST()
2670 CHECK_EQ(2008, obj->Get(env.local(), sym2) in THREADED_TEST()
2672 ->Int32Value(env.local()) in THREADED_TEST()
2674 CHECK_EQ(2002, obj->Get(env.local(), sym1) in THREADED_TEST()
2676 ->Int32Value(env.local()) in THREADED_TEST()
2679 obj->GetOwnPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2681 CHECK(obj->Has(env.local(), sym1).FromJust()); in THREADED_TEST()
2682 CHECK(obj->Has(env.local(), sym2).FromJust()); in THREADED_TEST()
2683 CHECK(obj->Has(env.local(), sym3).FromJust()); in THREADED_TEST()
2684 CHECK(obj->Has(env.local(), v8_str("accessor_sym3")).FromJust()); in THREADED_TEST()
2685 CHECK(obj->Delete(env.local(), sym2).FromJust()); in THREADED_TEST()
2686 CHECK(obj->Has(env.local(), sym1).FromJust()); in THREADED_TEST()
2687 CHECK(!obj->Has(env.local(), sym2).FromJust()); in THREADED_TEST()
2688 CHECK(obj->Has(env.local(), sym3).FromJust()); in THREADED_TEST()
2689 CHECK(obj->Has(env.local(), v8_str("accessor_sym3")).FromJust()); in THREADED_TEST()
2690 CHECK_EQ(2002, obj->Get(env.local(), sym1) in THREADED_TEST()
2692 ->Int32Value(env.local()) in THREADED_TEST()
2694 CHECK(obj->Get(env.local(), sym3) in THREADED_TEST()
2696 ->Equals(env.local(), v8::Integer::New(isolate, 42)) in THREADED_TEST()
2698 CHECK(obj->Get(env.local(), v8_str("accessor_sym3")) in THREADED_TEST()
2700 ->Equals(env.local(), v8::Integer::New(isolate, 42)) in THREADED_TEST()
2703 obj->GetOwnPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2706 v8::Local<v8::Object> child = v8::Object::New(isolate); in THREADED_TEST()
2707 CHECK(child->SetPrototype(env.local(), obj).FromJust()); in THREADED_TEST()
2708 CHECK(child->Has(env.local(), sym1).FromJust()); in THREADED_TEST()
2709 CHECK_EQ(2002, child->Get(env.local(), sym1) in THREADED_TEST()
2711 ->Int32Value(env.local()) in THREADED_TEST()
2713 CHECK(obj->Get(env.local(), sym3) in THREADED_TEST()
2715 ->Equals(env.local(), v8::Integer::New(isolate, 42)) in THREADED_TEST()
2717 CHECK(obj->Get(env.local(), v8_str("accessor_sym3")) in THREADED_TEST()
2719 ->Equals(env.local(), v8::Integer::New(isolate, 42)) in THREADED_TEST()
2722 child->GetOwnPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2730 v8::Local<v8::FunctionTemplate> foo = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
2731 v8::Local<v8::Name> name = v8::Symbol::New(isolate); in THREADED_TEST()
2734 v8::Local<v8::Object> new_instance = in THREADED_TEST()
2735 foo->InstanceTemplate()->NewInstance(env.local()).ToLocalChecked(); in THREADED_TEST()
2737 CHECK(new_instance->Has(env.local(), name).FromJust()); in THREADED_TEST()
2747 v8::Local<v8::Object> target = CompileRun("({})").As<v8::Object>(); in THREADED_TEST()
2748 v8::Local<v8::Object> handler = CompileRun("({})").As<v8::Object>(); in THREADED_TEST()
2750 v8::Local<v8::Proxy> proxy = in THREADED_TEST()
2751 v8::Proxy::New(env.local(), target, handler).ToLocalChecked(); in THREADED_TEST()
2753 v8::Local<v8::Private> priv1 = v8::Private::New(isolate); in THREADED_TEST()
2754 v8::Local<v8::Private> priv2 = in THREADED_TEST()
2760 ->Equals(env.local(), in THREADED_TEST()
2767 proxy->DeletePrivate(env.local(), priv1).FromJust(); in THREADED_TEST()
2768 CHECK(!proxy->HasPrivate(env.local(), priv1).FromJust()); in THREADED_TEST()
2770 CHECK(proxy->SetPrivate(env.local(), priv1, v8::Integer::New(isolate, 1503)) in THREADED_TEST()
2772 CHECK(proxy->HasPrivate(env.local(), priv1).FromJust()); in THREADED_TEST()
2773 CHECK_EQ(1503, proxy->GetPrivate(env.local(), priv1) in THREADED_TEST()
2775 ->Int32Value(env.local()) in THREADED_TEST()
2777 CHECK(proxy->SetPrivate(env.local(), priv1, v8::Integer::New(isolate, 2002)) in THREADED_TEST()
2779 CHECK(proxy->HasPrivate(env.local(), priv1).FromJust()); in THREADED_TEST()
2780 CHECK_EQ(2002, proxy->GetPrivate(env.local(), priv1) in THREADED_TEST()
2782 ->Int32Value(env.local()) in THREADED_TEST()
2786 proxy->GetOwnPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2788 proxy->GetPropertyNames(env.local()).ToLocalChecked()->Length(); in THREADED_TEST()
2789 CHECK(proxy->Set(env.local(), v8::String::NewFromUtf8( in THREADED_TEST()
2795 proxy->GetOwnPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2797 proxy->GetPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2803 CHECK(proxy->SetPrivate(env.local(), priv2, v8::Integer::New(isolate, 2008)) in THREADED_TEST()
2805 CHECK_EQ(2002, proxy->GetPrivate(env.local(), priv1) in THREADED_TEST()
2807 ->Int32Value(env.local()) in THREADED_TEST()
2809 CHECK_EQ(2008, proxy->GetPrivate(env.local(), priv2) in THREADED_TEST()
2811 ->Int32Value(env.local()) in THREADED_TEST()
2813 CHECK_EQ(2002, proxy->GetPrivate(env.local(), priv1) in THREADED_TEST()
2815 ->Int32Value(env.local()) in THREADED_TEST()
2818 proxy->GetOwnPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2820 CHECK(proxy->HasPrivate(env.local(), priv1).FromJust()); in THREADED_TEST()
2821 CHECK(proxy->HasPrivate(env.local(), priv2).FromJust()); in THREADED_TEST()
2822 CHECK(proxy->DeletePrivate(env.local(), priv2).FromJust()); in THREADED_TEST()
2823 CHECK(proxy->HasPrivate(env.local(), priv1).FromJust()); in THREADED_TEST()
2824 CHECK(!proxy->HasPrivate(env.local(), priv2).FromJust()); in THREADED_TEST()
2825 CHECK_EQ(2002, proxy->GetPrivate(env.local(), priv1) in THREADED_TEST()
2827 ->Int32Value(env.local()) in THREADED_TEST()
2830 proxy->GetOwnPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2833 v8::Local<v8::Object> child = v8::Object::New(isolate); in THREADED_TEST()
2834 CHECK(child->SetPrototype(env.local(), proxy).FromJust()); in THREADED_TEST()
2835 CHECK(!child->HasPrivate(env.local(), priv1).FromJust()); in THREADED_TEST()
2837 child->GetOwnPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2846 v8::Local<v8::Object> obj = v8::Object::New(isolate); in THREADED_TEST()
2847 v8::Local<v8::Private> priv1 = v8::Private::New(isolate); in THREADED_TEST()
2848 v8::Local<v8::Private> priv2 = in THREADED_TEST()
2854 ->Equals(env.local(), in THREADED_TEST()
2861 obj->DeletePrivate(env.local(), priv1).FromJust(); in THREADED_TEST()
2862 CHECK(!obj->HasPrivate(env.local(), priv1).FromJust()); in THREADED_TEST()
2864 CHECK(obj->SetPrivate(env.local(), priv1, v8::Integer::New(isolate, 1503)) in THREADED_TEST()
2866 CHECK(obj->HasPrivate(env.local(), priv1).FromJust()); in THREADED_TEST()
2867 CHECK_EQ(1503, obj->GetPrivate(env.local(), priv1) in THREADED_TEST()
2869 ->Int32Value(env.local()) in THREADED_TEST()
2871 CHECK(obj->SetPrivate(env.local(), priv1, v8::Integer::New(isolate, 2002)) in THREADED_TEST()
2873 CHECK(obj->HasPrivate(env.local(), priv1).FromJust()); in THREADED_TEST()
2874 CHECK_EQ(2002, obj->GetPrivate(env.local(), priv1) in THREADED_TEST()
2876 ->Int32Value(env.local()) in THREADED_TEST()
2880 obj->GetOwnPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2882 obj->GetPropertyNames(env.local()).ToLocalChecked()->Length(); in THREADED_TEST()
2883 CHECK(obj->Set(env.local(), v8::String::NewFromUtf8( in THREADED_TEST()
2889 obj->GetOwnPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2891 obj->GetPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2897 CHECK(obj->SetPrivate(env.local(), priv2, v8::Integer::New(isolate, 2008)) in THREADED_TEST()
2899 CHECK_EQ(2002, obj->GetPrivate(env.local(), priv1) in THREADED_TEST()
2901 ->Int32Value(env.local()) in THREADED_TEST()
2903 CHECK_EQ(2008, obj->GetPrivate(env.local(), priv2) in THREADED_TEST()
2905 ->Int32Value(env.local()) in THREADED_TEST()
2907 CHECK_EQ(2002, obj->GetPrivate(env.local(), priv1) in THREADED_TEST()
2909 ->Int32Value(env.local()) in THREADED_TEST()
2912 obj->GetOwnPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2914 CHECK(obj->HasPrivate(env.local(), priv1).FromJust()); in THREADED_TEST()
2915 CHECK(obj->HasPrivate(env.local(), priv2).FromJust()); in THREADED_TEST()
2916 CHECK(obj->DeletePrivate(env.local(), priv2).FromJust()); in THREADED_TEST()
2917 CHECK(obj->HasPrivate(env.local(), priv1).FromJust()); in THREADED_TEST()
2918 CHECK(!obj->HasPrivate(env.local(), priv2).FromJust()); in THREADED_TEST()
2919 CHECK_EQ(2002, obj->GetPrivate(env.local(), priv1) in THREADED_TEST()
2921 ->Int32Value(env.local()) in THREADED_TEST()
2924 obj->GetOwnPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2927 v8::Local<v8::Object> child = v8::Object::New(isolate); in THREADED_TEST()
2928 CHECK(child->SetPrototype(env.local(), obj).FromJust()); in THREADED_TEST()
2929 CHECK(!child->HasPrivate(env.local(), priv1).FromJust()); in THREADED_TEST()
2931 child->GetOwnPropertyNames(env.local()).ToLocalChecked()->Length()); in THREADED_TEST()
2940 v8::Local<String> name = v8_str("my-symbol"); in THREADED_TEST()
2941 v8::Local<v8::Symbol> glob = v8::Symbol::For(isolate, name); in THREADED_TEST()
2942 v8::Local<v8::Symbol> glob2 = v8::Symbol::For(isolate, name); in THREADED_TEST()
2945 v8::Local<v8::Symbol> glob_api = v8::Symbol::ForApi(isolate, name); in THREADED_TEST()
2946 v8::Local<v8::Symbol> glob_api2 = v8::Symbol::ForApi(isolate, name); in THREADED_TEST()
2950 v8::Local<v8::Symbol> sym = v8::Symbol::New(isolate, name); in THREADED_TEST()
2954 v8::Local<Value> sym2 = in THREADED_TEST()
2955 env->Global()->Get(env.local(), v8_str("sym2")).ToLocalChecked(); in THREADED_TEST()
2961 static void CheckWellKnownSymbol(v8::Local<v8::Symbol>(*getter)(v8::Isolate*), in CheckWellKnownSymbol()
2967 v8::Local<v8::Symbol> symbol = getter(isolate); in CheckWellKnownSymbol()
2970 v8::Local<Value> value = in CheckWellKnownSymbol()
2971 env->Global()->Get(env.local(), v8_str("sym")).ToLocalChecked(); in CheckWellKnownSymbol()
2991 v8::Local<String> name = v8_str("my-private"); in THREADED_TEST()
2992 v8::Local<v8::Private> glob = v8::Private::ForApi(isolate, name); in THREADED_TEST()
2993 v8::Local<v8::Object> obj = v8::Object::New(isolate); in THREADED_TEST()
2994 CHECK(obj->SetPrivate(env.local(), glob, v8::Integer::New(isolate, 3)) in THREADED_TEST()
2997 v8::Local<v8::Private> glob2 = v8::Private::ForApi(isolate, name); in THREADED_TEST()
2998 CHECK(obj->HasPrivate(env.local(), glob2).FromJust()); in THREADED_TEST()
3000 v8::Local<v8::Private> priv = v8::Private::New(isolate, name); in THREADED_TEST()
3001 CHECK(!obj->HasPrivate(env.local(), priv).FromJust()); in THREADED_TEST()
3004 v8::Local<Value> intern = in THREADED_TEST()
3005 env->Global()->Get(env.local(), v8_str("intern")).ToLocalChecked(); in THREADED_TEST()
3006 CHECK(!obj->Has(env.local(), intern).FromJust()); in THREADED_TEST()
3023 static void CheckInternalFieldsAreZero(v8::Local<T> value) { in CheckInternalFieldsAreZero()
3038 Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(isolate, 1024); in THREADED_TEST()
3050 CHECK(env->Global()->Set(env.local(), v8_str("ab"), ab).FromJust()); in THREADED_TEST()
3052 v8::Local<v8::Value> result = CompileRun("ab.byteLength"); in THREADED_TEST()
3053 CHECK_EQ(1024, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3060 CHECK_EQ(1024, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3066 CHECK_EQ(0xDD, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3076 v8::Local<v8::Value> result = CompileRun( in THREADED_TEST()
3081 Local<v8::ArrayBuffer> ab1 = Local<v8::ArrayBuffer>::Cast(result); in THREADED_TEST()
3089 CHECK_EQ(2, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3091 CHECK_EQ(0xAA, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3093 CHECK_EQ(0xFF, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3098 CHECK_EQ(0xBB, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3100 CHECK_EQ(0xFF, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3109 CHECK_EQ(0xDD, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3120 Local<v8::ArrayBuffer> ab3 = in THREADED_TEST()
3126 CHECK(env->Global()->Set(env.local(), v8_str("ab3"), ab3).FromJust()); in THREADED_TEST()
3128 v8::Local<v8::Value> result = CompileRun("ab3.byteLength"); in THREADED_TEST()
3129 CHECK_EQ(100, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3136 CHECK_EQ(100, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3142 CHECK_EQ(0xDD, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3153 Local<v8::ArrayBuffer> ab = in THREADED_TEST()
3164 static void CheckDataViewIsNeutered(v8::Local<v8::DataView> dv) { in CheckDataViewIsNeutered()
3170 static void CheckIsNeutered(v8::Local<v8::TypedArray> ta) { in CheckIsNeutered()
3183 v8::Local<v8::TypedArray> ta = in CheckIsTypedArrayVarNeutered()
3184 v8::Local<v8::TypedArray>::Cast(CompileRun(name)); in CheckIsTypedArrayVarNeutered()
3190 static Local<TypedArray> CreateAndCheck(Local<v8::ArrayBuffer> ab, in CreateAndCheck()
3192 v8::Local<TypedArray> ta = TypedArray::New(ab, byteOffset, length); in CreateAndCheck()
3206 v8::Local<v8::ArrayBuffer> buffer = v8::ArrayBuffer::New(isolate, 1024); in THREADED_TEST()
3208 v8::Local<v8::Uint8Array> u8a = in THREADED_TEST()
3210 v8::Local<v8::Uint8ClampedArray> u8c = in THREADED_TEST()
3212 v8::Local<v8::Int8Array> i8a = in THREADED_TEST()
3215 v8::Local<v8::Uint16Array> u16a = in THREADED_TEST()
3217 v8::Local<v8::Int16Array> i16a = in THREADED_TEST()
3220 v8::Local<v8::Uint32Array> u32a = in THREADED_TEST()
3222 v8::Local<v8::Int32Array> i32a = in THREADED_TEST()
3225 v8::Local<v8::Float32Array> f32a = in THREADED_TEST()
3227 v8::Local<v8::Float64Array> f64a = in THREADED_TEST()
3230 v8::Local<v8::DataView> dv = v8::DataView::New(buffer, 1, 1023); in THREADED_TEST()
3269 v8::Local<v8::ArrayBuffer> ab = in THREADED_TEST()
3270 Local<v8::ArrayBuffer>::Cast(CompileRun("ab")); in THREADED_TEST()
3272 v8::Local<v8::DataView> dv = v8::Local<v8::DataView>::Cast(CompileRun("dv")); in THREADED_TEST()
3314 Local<v8::SharedArrayBuffer> ab = v8::SharedArrayBuffer::New(isolate, 1024); in THREADED_TEST()
3326 CHECK(env->Global()->Set(env.local(), v8_str("ab"), ab).FromJust()); in THREADED_TEST()
3328 v8::Local<v8::Value> result = CompileRun("ab.byteLength"); in THREADED_TEST()
3329 CHECK_EQ(1024, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3336 CHECK_EQ(1024, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3342 CHECK_EQ(0xDD, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3353 v8::Local<v8::Value> result = CompileRun( in THREADED_TEST()
3358 Local<v8::SharedArrayBuffer> ab1 = Local<v8::SharedArrayBuffer>::Cast(result); in THREADED_TEST()
3366 CHECK_EQ(2, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3368 CHECK_EQ(0xAA, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3370 CHECK_EQ(0xFF, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3375 CHECK_EQ(0xBB, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3377 CHECK_EQ(0xFF, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3386 CHECK_EQ(0xDD, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3398 Local<v8::SharedArrayBuffer> ab3 = in THREADED_TEST()
3404 CHECK(env->Global()->Set(env.local(), v8_str("ab3"), ab3).FromJust()); in THREADED_TEST()
3406 v8::Local<v8::Value> result = CompileRun("ab3.byteLength"); in THREADED_TEST()
3407 CHECK_EQ(100, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3414 CHECK_EQ(100, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3420 CHECK_EQ(0xDD, result->Int32Value(env.local()).FromJust()); in THREADED_TEST()
3429 v8::Local<v8::Object> obj = v8::Object::New(env->GetIsolate()); in THREADED_TEST()
3430 v8::Local<v8::Private> key = in THREADED_TEST()
3432 v8::Local<v8::String> empty = v8_str(""); in THREADED_TEST()
3433 v8::Local<v8::String> prop_name = v8_str("prop_name"); in THREADED_TEST()
3438 obj->DeletePrivate(env.local(), key).FromJust(); in THREADED_TEST()
3440 CHECK(obj->SetPrivate(env.local(), key, v8::Integer::New(isolate, 1503)) in THREADED_TEST()
3442 CHECK_EQ(1503, obj->GetPrivate(env.local(), key) in THREADED_TEST()
3444 ->Int32Value(env.local()) in THREADED_TEST()
3446 CHECK(obj->SetPrivate(env.local(), key, v8::Integer::New(isolate, 2002)) in THREADED_TEST()
3448 CHECK_EQ(2002, obj->GetPrivate(env.local(), key) in THREADED_TEST()
3450 ->Int32Value(env.local()) in THREADED_TEST()
3456 CHECK(!obj->Has(env.local(), empty).FromJust()); in THREADED_TEST()
3457 CHECK_EQ(2002, obj->GetPrivate(env.local(), key) in THREADED_TEST()
3459 ->Int32Value(env.local()) in THREADED_TEST()
3461 CHECK(obj->Get(env.local(), empty).ToLocalChecked()->IsUndefined()); in THREADED_TEST()
3462 CHECK_EQ(2002, obj->GetPrivate(env.local(), key) in THREADED_TEST()
3464 ->Int32Value(env.local()) in THREADED_TEST()
3467 obj->Set(env.local(), empty, v8::Integer::New(isolate, 2003)).FromJust()); in THREADED_TEST()
3468 CHECK_EQ(2002, obj->GetPrivate(env.local(), key) in THREADED_TEST()
3470 ->Int32Value(env.local()) in THREADED_TEST()
3472 CHECK_EQ(2003, obj->Get(env.local(), empty) in THREADED_TEST()
3474 ->Int32Value(env.local()) in THREADED_TEST()
3481 CHECK(obj->Set(env.local(), prop_name, v8::Integer::New(isolate, 2008)) in THREADED_TEST()
3483 CHECK_EQ(2002, obj->GetPrivate(env.local(), key) in THREADED_TEST()
3485 ->Int32Value(env.local()) in THREADED_TEST()
3487 CHECK_EQ(2008, obj->Get(env.local(), prop_name) in THREADED_TEST()
3489 ->Int32Value(env.local()) in THREADED_TEST()
3491 CHECK_EQ(2002, obj->GetPrivate(env.local(), key) in THREADED_TEST()
3493 ->Int32Value(env.local()) in THREADED_TEST()
3495 CHECK(obj->Delete(env.local(), prop_name).FromJust()); in THREADED_TEST()
3496 CHECK_EQ(2002, obj->GetPrivate(env.local(), key) in THREADED_TEST()
3498 ->Int32Value(env.local()) in THREADED_TEST()
3503 CHECK(obj->SetPrivate(env.local(), key, v8::Integer::New(isolate, 2002)) in THREADED_TEST()
3505 CHECK(obj->DeletePrivate(env.local(), key).FromJust()); in THREADED_TEST()
3506 CHECK(!obj->HasPrivate(env.local(), key).FromJust()); in THREADED_TEST()
3517 v8::Local<v8::Object> obj = v8::Object::New(env->GetIsolate()); in THREADED_TEST()
3518 v8::Local<v8::Private> key = in THREADED_TEST()
3529 CHECK(!obj->HasPrivate(env.local(), key).FromJust()); in THREADED_TEST()
3534 obj->SetPrivate(env.local(), key, v8::Integer::New(env->GetIsolate(), 42)) in THREADED_TEST()
3537 CHECK_EQ(42, obj->GetPrivate(env.local(), key) in THREADED_TEST()
3539 ->Int32Value(env.local()) in THREADED_TEST()
3547 Local<v8::External> ext = v8::External::New(CcTest::isolate(), &x); in THREADED_TEST()
3549 CHECK(env->Global()->Set(env.local(), v8_str("ext"), ext).FromJust()); in THREADED_TEST()
3550 Local<Value> reext_obj = CompileRun("this.ext"); in THREADED_TEST()
3551 v8::Local<v8::External> reext = reext_obj.As<v8::External>(); in THREADED_TEST()
3559 Local<v8::Value> zero = v8::External::New(CcTest::isolate(), &data[0]); in THREADED_TEST()
3560 Local<v8::Value> one = v8::External::New(CcTest::isolate(), &data[1]); in THREADED_TEST()
3561 Local<v8::Value> two = v8::External::New(CcTest::isolate(), &data[2]); in THREADED_TEST()
3562 Local<v8::Value> three = v8::External::New(CcTest::isolate(), &data[3]); in THREADED_TEST()
3585 CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 3); in THREADED_TEST()
3594 CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 3); in THREADED_TEST()
3612 CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 3); in THREADED_TEST()
3621 CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 6); in THREADED_TEST()
3640 CHECK_EQ(v8::Local<String>::New(isolate, global)->Length(), 3); in THREADED_TEST()
3644 Local<String> empty; in THREADED_TEST()
3843 Local<v8::Object> NewObjectForIntKey( in NewObjectForIntKey()
3846 auto local = Local<v8::ObjectTemplate>::New(isolate, templ); in NewObjectForIntKey() local
3847 auto obj = local->NewInstance(isolate->GetCurrentContext()).ToLocalChecked(); in NewObjectForIntKey()
3864 Local<V> value) { in WeakCallbackParameter()
3912 Local<v8::Object> obj = map.Get(7); in TestGlobalValueMap()
3914 Local<v8::Object> expected = v8::Object::New(isolate); in TestGlobalValueMap()
3918 CHECK(expected->Equals(env.local(), obj).FromJust()); in TestGlobalValueMap()
3921 CHECK(expected->Equals(env.local(), ref.NewLocal(isolate)).FromJust()); in TestGlobalValueMap()
3934 Local<v8::Object> expected2 = NewObjectForIntKey(isolate, templ, 8); in TestGlobalValueMap()
3938 CHECK(expected2->Equals(env.local(), ref.NewLocal(isolate)).FromJust()); in TestGlobalValueMap()
3952 Local<v8::Object> value = NewObjectForIntKey(isolate, templ, 9); in TestGlobalValueMap()
3984 Local<v8::Object> obj1 = v8::Object::New(isolate); in TEST()
3985 Local<v8::Object> obj2 = v8::Object::New(isolate); in TEST()
4003 CHECK(obj1->Equals(env.local(), vector.Get(0)).FromJust()); in TEST()
4004 CHECK(obj1->Equals(env.local(), vector.Get(2)).FromJust()); in TEST()
4005 CHECK(obj1->Equals(env.local(), vector.Get(4)).FromJust()); in TEST()
4006 CHECK(obj2->Equals(env.local(), vector.Get(1)).FromJust()); in TEST()
4020 v8::Local<String> local = v8::Local<String>::New(isolate, v8_str("str")); in THREADED_TEST() local
4021 v8::Persistent<String> global_string(isolate, local); in THREADED_TEST()
4024 CHECK(v8::Local<v8::Value>::New(isolate, global_value)->IsString()); in THREADED_TEST()
4043 Local<String> local1 = Local<String>::New(isolate, global1); in THREADED_TEST()
4044 Local<String> local2 = Local<String>::New(isolate, global2); in THREADED_TEST()
4059 Local<String> anotherLocal1 = Local<String>::New(isolate, global1); in THREADED_TEST()
4070 v8::Local<String> local = in THREADED_TEST() local
4071 v8::Local<String>::New(CcTest::isolate(), v8_str("str")); in THREADED_TEST()
4072 CHECK_EQ(local->Length(), 3); in THREADED_TEST()
4156 CHECK(Local<Object>::New(iso, g1s2.handle.As<Object>()) in THREADED_TEST()
4157 ->Set(env.local(), 0, Local<Value>::New(iso, g2s2.handle)) in THREADED_TEST()
4159 CHECK(Local<Object>::New(iso, g2s1.handle.As<Object>()) in THREADED_TEST()
4160 ->Set(env.local(), 0, Local<Value>::New(iso, g1s1.handle)) in THREADED_TEST()
4261 CHECK(Local<Object>::New(iso, g1s1.handle) in THREADED_TEST()
4262 ->Set(env.local(), 0, Local<Object>::New(iso, g2s1.handle)) in THREADED_TEST()
4264 CHECK(Local<Object>::New(iso, g2s1.handle) in THREADED_TEST()
4265 ->Set(env.local(), 0, Local<Object>::New(iso, g1s1.handle)) in THREADED_TEST()
4501 Local<Object>::New(iso, g1s1.handle.As<Object>()) in TEST()
4502 ->Set(env.local(), v8_str("x"), Local<Value>::New(iso, g2s1.handle)) in TEST()
4506 Local<Object>::New(iso, g2s1.handle.As<Object>()) in TEST()
4507 ->Set(env.local(), v8_str("x"), Local<Value>::New(iso, g3s1.handle)) in TEST()
4511 Local<Object>::New(iso, g3s1.handle.As<Object>()) in TEST()
4512 ->Set(env.local(), v8_str("x"), Local<Value>::New(iso, g1s1.handle)) in TEST()
4539 Local<Object>::New(iso, g1s1.handle.As<Object>()) in TEST()
4540 ->Set(env.local(), v8_str("x"), Local<Value>::New(iso, g2s1.handle)) in TEST()
4544 Local<Object>::New(iso, g2s1.handle.As<Object>()) in TEST()
4545 ->Set(env.local(), v8_str("x"), Local<Value>::New(iso, g3s1.handle)) in TEST()
4549 Local<Object>::New(iso, g3s1.handle.As<Object>()) in TEST()
4550 ->Set(env.local(), v8_str("x"), Local<Value>::New(iso, g1s1.handle)) in TEST()
4564 Local<Script> script = v8_compile("throw 'panama!';"); in THREADED_TEST()
4566 v8::MaybeLocal<Value> result = script->Run(env.local()); in THREADED_TEST()
4584 ->ToObject(env.local()) in TEST()
4586 ->Get(env.local(), v8_str("a")) in TEST()
4588 ->Equals(env.local(), v8_str("b")) in TEST()
4596 static void check_message_0(v8::Local<v8::Message> message, in check_message_0()
4597 v8::Local<Value> data) { in check_message_0()
4615 v8::Local<v8::Script> script = CompileWithOrigin("throw 'error'", "6.75"); in THREADED_TEST()
4616 CHECK(script->Run(context.local()).IsEmpty()); in THREADED_TEST()
4623 static void check_message_1(v8::Local<v8::Message> message, in check_message_1()
4624 v8::Local<Value> data) { in check_message_1()
4646 static void check_message_2(v8::Local<v8::Message> message, in check_message_2()
4647 v8::Local<Value> data) { in check_message_2()
4650 v8::Local<v8::Value> hidden_property = in check_message_2()
4653 context.local(), in check_message_2()
4657 ->Equals(context.local(), hidden_property) in check_message_2()
4670 v8::Local<v8::Value> error = v8::Exception::Error(v8_str("custom error")); in TEST()
4672 ->SetPrivate(context.local(), in TEST()
4677 ->Set(context.local(), v8_str("error"), error) in TEST()
4686 static void check_message_3(v8::Local<v8::Message> message, in check_message_3()
4687 v8::Local<Value> data) { in check_message_3()
4713 v8::Integer::New(isolate, 2), v8::True(isolate), Local<v8::Integer>(), in TEST()
4715 v8::Local<v8::Script> script = in TEST()
4716 Script::Compile(context.local(), v8_str("throw 'error'"), &origin) in TEST()
4718 CHECK(script->Run(context.local()).IsEmpty()); in TEST()
4725 static void check_message_4(v8::Local<v8::Message> message, in check_message_4()
4726 v8::Local<Value> data) { in check_message_4()
4746 v8::Local<v8::Script> script = in TEST()
4747 Script::Compile(context.local(), v8_str("throw 'error'"), &origin) in TEST()
4749 CHECK(script->Run(context.local()).IsEmpty()); in TEST()
4756 static void check_message_5a(v8::Local<v8::Message> message, in check_message_5a()
4757 v8::Local<Value> data) { in check_message_5a()
4767 static void check_message_5b(v8::Local<v8::Message> message, in check_message_5b()
4768 v8::Local<Value> data) { in check_message_5b()
4788 v8::Local<v8::Script> script = in TEST()
4789 Script::Compile(context.local(), v8_str("throw 'error'"), &origin1) in TEST()
4791 CHECK(script->Run(context.local()).IsEmpty()); in TEST()
4801 script = Script::Compile(context.local(), v8_str("throw 'error'"), &origin2) in TEST()
4803 CHECK(script->Run(context.local()).IsEmpty()); in TEST()
4813 Local<v8::NativeWeakMap> weak_map(v8::NativeWeakMap::New(isolate)); in TEST()
4817 Local<Object> value = v8::Object::New(isolate); in TEST()
4819 Local<Object> local1 = v8::Object::New(isolate); in TEST()
4824 CHECK(value->Equals(env.local(), weak_map->Get(local1)).FromJust()); in TEST()
4832 Local<v8::Object> obj1 = v8::Object::New(isolate); in TEST()
4833 Local<v8::Object> obj2 = v8::Object::New(isolate); in TEST()
4834 Local<v8::Symbol> sym1 = v8::Symbol::New(isolate); in TEST()
4849 CHECK(value->Equals(env.local(), weak_map->Get(local1)).FromJust()); in TEST()
4850 CHECK(value->Equals(env.local(), weak_map->Get(obj1)).FromJust()); in TEST()
4851 CHECK(value->Equals(env.local(), weak_map->Get(obj2)).FromJust()); in TEST()
4852 CHECK(value->Equals(env.local(), weak_map->Get(sym1)).FromJust()); in TEST()
4857 CHECK(value->Equals(env.local(), weak_map->Get(local1)).FromJust()); in TEST()
4858 CHECK(value->Equals(env.local(), in TEST()
4859 weak_map->Get(Local<Value>::New(isolate, o1.handle))) in TEST()
4861 CHECK(value->Equals(env.local(), in TEST()
4862 weak_map->Get(Local<Value>::New(isolate, o2.handle))) in TEST()
4864 CHECK(value->Equals(env.local(), in TEST()
4865 weak_map->Get(Local<Value>::New(isolate, s1.handle))) in TEST()
4883 CHECK(value->Equals(env.local(), weak_map->Get(local1)).FromJust()); in TEST()
4895 ->Set(context.local(), v8_str("foo"), v8_num(14)) in THREADED_TEST()
4898 ->Set(context.local(), v8_str("12"), v8_num(92)) in THREADED_TEST()
4901 ->Set(context.local(), v8::Integer::New(isolate, 16), v8_num(32)) in THREADED_TEST()
4904 ->Set(context.local(), v8_num(13), v8_num(56)) in THREADED_TEST()
4906 Local<Value> foo = CompileRun("this.foo"); in THREADED_TEST()
4907 CHECK_EQ(14, foo->Int32Value(context.local()).FromJust()); in THREADED_TEST()
4908 Local<Value> twelve = CompileRun("this[12]"); in THREADED_TEST()
4909 CHECK_EQ(92, twelve->Int32Value(context.local()).FromJust()); in THREADED_TEST()
4910 Local<Value> sixteen = CompileRun("this[16]"); in THREADED_TEST()
4911 CHECK_EQ(32, sixteen->Int32Value(context.local()).FromJust()); in THREADED_TEST()
4912 Local<Value> thirteen = CompileRun("this[13]"); in THREADED_TEST()
4913 CHECK_EQ(56, thirteen->Int32Value(context.local()).FromJust()); in THREADED_TEST()
4915 ->Get(context.local(), v8::Integer::New(isolate, 12)) in THREADED_TEST()
4917 ->Int32Value(context.local()) in THREADED_TEST()
4920 ->Get(context.local(), v8_str("12")) in THREADED_TEST()
4922 ->Int32Value(context.local()) in THREADED_TEST()
4925 ->Get(context.local(), v8_num(12)) in THREADED_TEST()
4927 ->Int32Value(context.local()) in THREADED_TEST()
4930 ->Get(context.local(), v8::Integer::New(isolate, 16)) in THREADED_TEST()
4932 ->Int32Value(context.local()) in THREADED_TEST()
4935 ->Get(context.local(), v8_str("16")) in THREADED_TEST()
4937 ->Int32Value(context.local()) in THREADED_TEST()
4940 ->Get(context.local(), v8_num(16)) in THREADED_TEST()
4942 ->Int32Value(context.local()) in THREADED_TEST()
4945 ->Get(context.local(), v8::Integer::New(isolate, 13)) in THREADED_TEST()
4947 ->Int32Value(context.local()) in THREADED_TEST()
4950 ->Get(context.local(), v8_str("13")) in THREADED_TEST()
4952 ->Int32Value(context.local()) in THREADED_TEST()
4955 ->Get(context.local(), v8_num(13)) in THREADED_TEST()
4957 ->Int32Value(context.local()) in THREADED_TEST()
4966 Local<String> prop = v8_str("none"); in THREADED_TEST()
4967 CHECK(context->Global()->Set(context.local(), prop, v8_num(7)).FromJust()); in THREADED_TEST()
4969 ->GetPropertyAttributes(context.local(), prop) in THREADED_TEST()
4974 ->DefineOwnProperty(context.local(), prop, v8_num(7), v8::ReadOnly) in THREADED_TEST()
4977 ->Get(context.local(), prop) in THREADED_TEST()
4979 ->Int32Value(context.local()) in THREADED_TEST()
4982 ->GetPropertyAttributes(context.local(), prop) in THREADED_TEST()
4986 ->Get(context.local(), prop) in THREADED_TEST()
4988 ->Int32Value(context.local()) in THREADED_TEST()
4990 CHECK(context->Global()->Set(context.local(), prop, v8_num(10)).FromJust()); in THREADED_TEST()
4992 ->Get(context.local(), prop) in THREADED_TEST()
4994 ->Int32Value(context.local()) in THREADED_TEST()
4999 ->DefineOwnProperty(context.local(), prop, v8_num(13), v8::DontDelete) in THREADED_TEST()
5002 ->Get(context.local(), prop) in THREADED_TEST()
5004 ->Int32Value(context.local()) in THREADED_TEST()
5008 ->Get(context.local(), prop) in THREADED_TEST()
5010 ->Int32Value(context.local()) in THREADED_TEST()
5013 ->GetPropertyAttributes(context.local(), prop) in THREADED_TEST()
5018 ->DefineOwnProperty(context.local(), prop, v8_num(28), v8::DontEnum) in THREADED_TEST()
5021 ->GetPropertyAttributes(context.local(), prop) in THREADED_TEST()
5026 ->GetPropertyAttributes(context.local(), prop) in THREADED_TEST()
5028 Local<Value> fake_prop = v8_num(1); in THREADED_TEST()
5030 ->GetPropertyAttributes(context.local(), fake_prop) in THREADED_TEST()
5034 Local<Value> exception = in THREADED_TEST()
5037 ->GetPropertyAttributes(context.local(), exception) in THREADED_TEST()
5049 Local<v8::Array> array = v8::Array::New(context->GetIsolate()); in THREADED_TEST()
5051 CHECK(array->Get(context.local(), 0).ToLocalChecked()->IsUndefined()); in THREADED_TEST()
5052 CHECK(!array->Has(context.local(), 0).FromJust()); in THREADED_TEST()
5053 CHECK(array->Get(context.local(), 100).ToLocalChecked()->IsUndefined()); in THREADED_TEST()
5054 CHECK(!array->Has(context.local(), 100).FromJust()); in THREADED_TEST()
5055 CHECK(array->Set(context.local(), 2, v8_num(7)).FromJust()); in THREADED_TEST()
5057 CHECK(!array->Has(context.local(), 0).FromJust()); in THREADED_TEST()
5058 CHECK(!array->Has(context.local(), 1).FromJust()); in THREADED_TEST()
5059 CHECK(array->Has(context.local(), 2).FromJust()); in THREADED_TEST()
5060 CHECK_EQ(7, array->Get(context.local(), 2) in THREADED_TEST()
5062 ->Int32Value(context.local()) in THREADED_TEST()
5064 Local<Value> obj = CompileRun("[1, 2, 3]"); in THREADED_TEST()
5065 Local<v8::Array> arr = obj.As<v8::Array>(); in THREADED_TEST()
5067 CHECK_EQ(1, arr->Get(context.local(), 0) in THREADED_TEST()
5069 ->Int32Value(context.local()) in THREADED_TEST()
5071 CHECK_EQ(2, arr->Get(context.local(), 1) in THREADED_TEST()
5073 ->Int32Value(context.local()) in THREADED_TEST()
5075 CHECK_EQ(3, arr->Get(context.local(), 2) in THREADED_TEST()
5077 ->Int32Value(context.local()) in THREADED_TEST()
5089 Local<v8::Array> result = v8::Array::New(args.GetIsolate(), args.Length()); in HandleF()
5101 Local<ObjectTemplate> global = ObjectTemplate::New(isolate); in THREADED_TEST()
5106 Local<v8::Array> a0 = CompileRun(fun).As<v8::Array>(); in THREADED_TEST()
5110 Local<v8::Array> a1 = CompileRun(fun2).As<v8::Array>(); in THREADED_TEST()
5112 CHECK_EQ(11, a1->Get(context.local(), 0) in THREADED_TEST()
5114 ->Int32Value(context.local()) in THREADED_TEST()
5118 Local<v8::Array> a2 = CompileRun(fun3).As<v8::Array>(); in THREADED_TEST()
5120 CHECK_EQ(12, a2->Get(context.local(), 0) in THREADED_TEST()
5122 ->Int32Value(context.local()) in THREADED_TEST()
5124 CHECK_EQ(13, a2->Get(context.local(), 1) in THREADED_TEST()
5126 ->Int32Value(context.local()) in THREADED_TEST()
5130 Local<v8::Array> a3 = CompileRun(fun4).As<v8::Array>(); in THREADED_TEST()
5132 CHECK_EQ(14, a3->Get(context.local(), 0) in THREADED_TEST()
5134 ->Int32Value(context.local()) in THREADED_TEST()
5136 CHECK_EQ(15, a3->Get(context.local(), 1) in THREADED_TEST()
5138 ->Int32Value(context.local()) in THREADED_TEST()
5140 CHECK_EQ(16, a3->Get(context.local(), 2) in THREADED_TEST()
5142 ->Int32Value(context.local()) in THREADED_TEST()
5146 Local<v8::Array> a4 = CompileRun(fun5).As<v8::Array>(); in THREADED_TEST()
5148 CHECK_EQ(17, a4->Get(context.local(), 0) in THREADED_TEST()
5150 ->Int32Value(context.local()) in THREADED_TEST()
5152 CHECK_EQ(18, a4->Get(context.local(), 1) in THREADED_TEST()
5154 ->Int32Value(context.local()) in THREADED_TEST()
5156 CHECK_EQ(19, a4->Get(context.local(), 2) in THREADED_TEST()
5158 ->Int32Value(context.local()) in THREADED_TEST()
5160 CHECK_EQ(20, a4->Get(context.local(), 3) in THREADED_TEST()
5162 ->Int32Value(context.local()) in THREADED_TEST()
5186 Local<Function> Foo = Local<Function>::Cast( in THREADED_TEST()
5187 context->Global()->Get(context.local(), v8_str("Foo")).ToLocalChecked()); in THREADED_TEST()
5188 Local<Function> ReturnThisSloppy = Local<Function>::Cast( in THREADED_TEST()
5190 ->Get(context.local(), v8_str("ReturnThisSloppy")) in THREADED_TEST()
5192 Local<Function> ReturnThisStrict = Local<Function>::Cast( in THREADED_TEST()
5194 ->Get(context.local(), v8_str("ReturnThisStrict")) in THREADED_TEST()
5197 v8::Local<Value>* args0 = NULL; in THREADED_TEST()
5198 Local<v8::Array> a0 = Local<v8::Array>::Cast( in THREADED_TEST()
5199 Foo->Call(context.local(), Foo, 0, args0).ToLocalChecked()); in THREADED_TEST()
5202 v8::Local<Value> args1[] = {v8_num(1.1)}; in THREADED_TEST()
5203 Local<v8::Array> a1 = Local<v8::Array>::Cast( in THREADED_TEST()
5204 Foo->Call(context.local(), Foo, 1, args1).ToLocalChecked()); in THREADED_TEST()
5206 CHECK_EQ(1.1, a1->Get(context.local(), v8::Integer::New(isolate, 0)) in THREADED_TEST()
5208 ->NumberValue(context.local()) in THREADED_TEST()
5211 v8::Local<Value> args2[] = {v8_num(2.2), v8_num(3.3)}; in THREADED_TEST()
5212 Local<v8::Array> a2 = Local<v8::Array>::Cast( in THREADED_TEST()
5213 Foo->Call(context.local(), Foo, 2, args2).ToLocalChecked()); in THREADED_TEST()
5215 CHECK_EQ(2.2, a2->Get(context.local(), v8::Integer::New(isolate, 0)) in THREADED_TEST()
5217 ->NumberValue(context.local()) in THREADED_TEST()
5219 CHECK_EQ(3.3, a2->Get(context.local(), v8::Integer::New(isolate, 1)) in THREADED_TEST()
5221 ->NumberValue(context.local()) in THREADED_TEST()
5224 v8::Local<Value> args3[] = {v8_num(4.4), v8_num(5.5), v8_num(6.6)}; in THREADED_TEST()
5225 Local<v8::Array> a3 = Local<v8::Array>::Cast( in THREADED_TEST()
5226 Foo->Call(context.local(), Foo, 3, args3).ToLocalChecked()); in THREADED_TEST()
5228 CHECK_EQ(4.4, a3->Get(context.local(), v8::Integer::New(isolate, 0)) in THREADED_TEST()
5230 ->NumberValue(context.local()) in THREADED_TEST()
5232 CHECK_EQ(5.5, a3->Get(context.local(), v8::Integer::New(isolate, 1)) in THREADED_TEST()
5234 ->NumberValue(context.local()) in THREADED_TEST()
5236 CHECK_EQ(6.6, a3->Get(context.local(), v8::Integer::New(isolate, 2)) in THREADED_TEST()
5238 ->NumberValue(context.local()) in THREADED_TEST()
5241 v8::Local<Value> args4[] = {v8_num(7.7), v8_num(8.8), v8_num(9.9), in THREADED_TEST()
5243 Local<v8::Array> a4 = Local<v8::Array>::Cast( in THREADED_TEST()
5244 Foo->Call(context.local(), Foo, 4, args4).ToLocalChecked()); in THREADED_TEST()
5246 CHECK_EQ(7.7, a4->Get(context.local(), v8::Integer::New(isolate, 0)) in THREADED_TEST()
5248 ->NumberValue(context.local()) in THREADED_TEST()
5250 CHECK_EQ(8.8, a4->Get(context.local(), v8::Integer::New(isolate, 1)) in THREADED_TEST()
5252 ->NumberValue(context.local()) in THREADED_TEST()
5254 CHECK_EQ(9.9, a4->Get(context.local(), v8::Integer::New(isolate, 2)) in THREADED_TEST()
5256 ->NumberValue(context.local()) in THREADED_TEST()
5258 CHECK_EQ(10.11, a4->Get(context.local(), v8::Integer::New(isolate, 3)) in THREADED_TEST()
5260 ->NumberValue(context.local()) in THREADED_TEST()
5263 Local<v8::Value> r1 = in THREADED_TEST()
5264 ReturnThisSloppy->Call(context.local(), v8::Undefined(isolate), 0, NULL) in THREADED_TEST()
5267 Local<v8::Value> r2 = in THREADED_TEST()
5268 ReturnThisSloppy->Call(context.local(), v8::Null(isolate), 0, NULL) in THREADED_TEST()
5271 Local<v8::Value> r3 = in THREADED_TEST()
5272 ReturnThisSloppy->Call(context.local(), v8_num(42), 0, NULL) in THREADED_TEST()
5276 Local<v8::Value> r4 = in THREADED_TEST()
5277 ReturnThisSloppy->Call(context.local(), v8_str("hello"), 0, NULL) in THREADED_TEST()
5281 Local<v8::Value> r5 = in THREADED_TEST()
5282 ReturnThisSloppy->Call(context.local(), v8::True(isolate), 0, NULL) in THREADED_TEST()
5287 Local<v8::Value> r6 = in THREADED_TEST()
5288 ReturnThisStrict->Call(context.local(), v8::Undefined(isolate), 0, NULL) in THREADED_TEST()
5291 Local<v8::Value> r7 = in THREADED_TEST()
5292 ReturnThisStrict->Call(context.local(), v8::Null(isolate), 0, NULL) in THREADED_TEST()
5295 Local<v8::Value> r8 = in THREADED_TEST()
5296 ReturnThisStrict->Call(context.local(), v8_num(42), 0, NULL) in THREADED_TEST()
5299 Local<v8::Value> r9 = in THREADED_TEST()
5300 ReturnThisStrict->Call(context.local(), v8_str("hello"), 0, NULL) in THREADED_TEST()
5303 Local<v8::Value> r10 = in THREADED_TEST()
5304 ReturnThisStrict->Call(context.local(), v8::True(isolate), 0, NULL) in THREADED_TEST()
5322 Local<Function> Foo = Local<Function>::Cast( in THREADED_TEST()
5323 context->Global()->Get(context.local(), v8_str("Foo")).ToLocalChecked()); in THREADED_TEST()
5325 v8::Local<Value>* args0 = NULL; in THREADED_TEST()
5326 Local<v8::Array> a0 = Local<v8::Array>::Cast( in THREADED_TEST()
5327 Foo->NewInstance(context.local(), 0, args0).ToLocalChecked()); in THREADED_TEST()
5330 v8::Local<Value> args1[] = {v8_num(1.1)}; in THREADED_TEST()
5331 Local<v8::Array> a1 = Local<v8::Array>::Cast( in THREADED_TEST()
5332 Foo->NewInstance(context.local(), 1, args1).ToLocalChecked()); in THREADED_TEST()
5334 CHECK_EQ(1.1, a1->Get(context.local(), v8::Integer::New(isolate, 0)) in THREADED_TEST()
5336 ->NumberValue(context.local()) in THREADED_TEST()
5339 v8::Local<Value> args2[] = {v8_num(2.2), v8_num(3.3)}; in THREADED_TEST()
5340 Local<v8::Array> a2 = Local<v8::Array>::Cast( in THREADED_TEST()
5341 Foo->NewInstance(context.local(), 2, args2).ToLocalChecked()); in THREADED_TEST()
5343 CHECK_EQ(2.2, a2->Get(context.local(), v8::Integer::New(isolate, 0)) in THREADED_TEST()
5345 ->NumberValue(context.local()) in THREADED_TEST()
5347 CHECK_EQ(3.3, a2->Get(context.local(), v8::Integer::New(isolate, 1)) in THREADED_TEST()
5349 ->NumberValue(context.local()) in THREADED_TEST()
5352 v8::Local<Value> args3[] = {v8_num(4.4), v8_num(5.5), v8_num(6.6)}; in THREADED_TEST()
5353 Local<v8::Array> a3 = Local<v8::Array>::Cast( in THREADED_TEST()
5354 Foo->NewInstance(context.local(), 3, args3).ToLocalChecked()); in THREADED_TEST()
5356 CHECK_EQ(4.4, a3->Get(context.local(), v8::Integer::New(isolate, 0)) in THREADED_TEST()
5358 ->NumberValue(context.local()) in THREADED_TEST()
5360 CHECK_EQ(5.5, a3->Get(context.local(), v8::Integer::New(isolate, 1)) in THREADED_TEST()
5362 ->NumberValue(context.local()) in THREADED_TEST()
5364 CHECK_EQ(6.6, a3->Get(context.local(), v8::Integer::New(isolate, 2)) in THREADED_TEST()
5366 ->NumberValue(context.local()) in THREADED_TEST()
5369 v8::Local<Value> args4[] = {v8_num(7.7), v8_num(8.8), v8_num(9.9), in THREADED_TEST()
5371 Local<v8::Array> a4 = Local<v8::Array>::Cast( in THREADED_TEST()
5372 Foo->NewInstance(context.local(), 4, args4).ToLocalChecked()); in THREADED_TEST()
5374 CHECK_EQ(7.7, a4->Get(context.local(), v8::Integer::New(isolate, 0)) in THREADED_TEST()
5376 ->NumberValue(context.local()) in THREADED_TEST()
5378 CHECK_EQ(8.8, a4->Get(context.local(), v8::Integer::New(isolate, 1)) in THREADED_TEST()
5380 ->NumberValue(context.local()) in THREADED_TEST()
5382 CHECK_EQ(9.9, a4->Get(context.local(), v8::Integer::New(isolate, 2)) in THREADED_TEST()
5384 ->NumberValue(context.local()) in THREADED_TEST()
5386 CHECK_EQ(10.11, a4->Get(context.local(), v8::Integer::New(isolate, 3)) in THREADED_TEST()
5388 ->NumberValue(context.local()) in THREADED_TEST()
5399 Local<Value> obj = in THREADED_TEST()
5400 env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5402 obj->ToNumber(env.local()).ToLocalChecked()->Value()); in THREADED_TEST()
5403 CHECK_EQ(0, obj->ToInt32(env.local()).ToLocalChecked()->Value()); in THREADED_TEST()
5405 obj->ToUint32(env.local()) in THREADED_TEST()
5410 obj = env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5412 obj->ToNumber(env.local()).ToLocalChecked()->Value()); in THREADED_TEST()
5413 CHECK_EQ(-1912276171, obj->ToInt32(env.local()).ToLocalChecked()->Value()); in THREADED_TEST()
5415 obj->ToUint32(env.local()).ToLocalChecked()->Value()); // NOLINT in THREADED_TEST()
5418 obj = env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5419 CHECK_EQ(42.0, obj->ToNumber(env.local()).ToLocalChecked()->Value()); in THREADED_TEST()
5420 CHECK_EQ(42, obj->ToInt32(env.local()).ToLocalChecked()->Value()); in THREADED_TEST()
5421 CHECK(42u == obj->ToUint32(env.local()).ToLocalChecked()->Value()); // NOLINT in THREADED_TEST()
5424 obj = env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5425 CHECK_EQ(-37.0, obj->ToNumber(env.local()).ToLocalChecked()->Value()); in THREADED_TEST()
5426 CHECK_EQ(-37, obj->ToInt32(env.local()).ToLocalChecked()->Value()); in THREADED_TEST()
5428 obj->ToUint32(env.local()).ToLocalChecked()->Value()); // NOLINT in THREADED_TEST()
5431 obj = env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5432 CHECK_EQ(2166572391.0, obj->ToNumber(env.local()).ToLocalChecked()->Value()); in THREADED_TEST()
5433 CHECK_EQ(-2128394905, obj->ToInt32(env.local()).ToLocalChecked()->Value()); in THREADED_TEST()
5435 obj->ToUint32(env.local()).ToLocalChecked()->Value()); // NOLINT in THREADED_TEST()
5438 obj = env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5439 CHECK_EQ(42.3, obj->ToNumber(env.local()).ToLocalChecked()->Value()); in THREADED_TEST()
5440 CHECK_EQ(42, obj->ToInt32(env.local()).ToLocalChecked()->Value()); in THREADED_TEST()
5441 CHECK(42u == obj->ToUint32(env.local()).ToLocalChecked()->Value()); // NOLINT in THREADED_TEST()
5444 obj = env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5446 obj->ToNumber(env.local()).ToLocalChecked()->Value()); in THREADED_TEST()
5447 CHECK_EQ(-1431655765, obj->ToInt32(env.local()).ToLocalChecked()->Value()); in THREADED_TEST()
5449 obj->ToUint32(env.local()).ToLocalChecked()->Value()); // NOLINT in THREADED_TEST()
5458 Local<Value> obj = in THREADED_TEST()
5459 env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5464 obj = env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5469 obj = env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5474 obj = env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5479 obj = env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5484 obj = env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5489 obj = env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5494 obj = env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5499 obj = env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5521 Local<Value> obj = in THREADED_TEST()
5522 env->Global()->Get(env.local(), v8_str("obj")).ToLocalChecked(); in THREADED_TEST()
5526 CHECK(obj->ToString(env.local()).IsEmpty()); in THREADED_TEST()
5529 CHECK(obj->ToNumber(env.local()).IsEmpty()); in THREADED_TEST()
5532 CHECK(obj->ToInteger(env.local()).IsEmpty()); in THREADED_TEST()
5535 CHECK(obj->ToUint32(env.local()).IsEmpty()); in THREADED_TEST()
5538 CHECK(obj->ToInt32(env.local()).IsEmpty()); in THREADED_TEST()
5541 CHECK(v8::Undefined(isolate)->ToObject(env.local()).IsEmpty()); in THREADED_TEST()
5545 CHECK(obj->Int32Value(env.local()).IsNothing()); in THREADED_TEST()
5548 CHECK(obj->Uint32Value(env.local()).IsNothing()); in THREADED_TEST()
5551 CHECK(obj->NumberValue(env.local()).IsNothing()); in THREADED_TEST()
5554 CHECK(obj->IntegerValue(env.local()).IsNothing()); in THREADED_TEST()
5572 Local<Value> result = in CCatcher()
5584 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
5595 Local<Value> thrown = context->Global() in THREADED_TEST()
5596 ->Get(context.local(), v8_str("thrown")) in THREADED_TEST()
5598 CHECK(thrown->BooleanValue(context.local()).FromJust()); in THREADED_TEST()
5605 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
5625 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
5628 Local<Value> result = CompileRun( in TEST()
5640 static void check_custom_error_tostring(v8::Local<v8::Message> message, in check_custom_error_tostring()
5641 v8::Local<v8::Value> data) { in check_custom_error_tostring()
5668 static void check_custom_error_message(v8::Local<v8::Message> message, in check_custom_error_message()
5669 v8::Local<v8::Value> data) { in check_custom_error_message()
5722 static void check_custom_rethrowing_message(v8::Local<v8::Message> message, in check_custom_rethrowing_message()
5723 v8::Local<v8::Value> data) { in check_custom_rethrowing_message()
5746 static void receive_message(v8::Local<v8::Message> message, in receive_message()
5747 v8::Local<v8::Value> data) { in receive_message()
5758 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
5773 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
5779 Local<Value> result = CompileRun("ThrowFromC();"); in TEST()
5794 Local<Value> result = CompileRun("function foo() { foo(); } foo();"); in TEST()
5805 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
5811 Local<Value> result = CompileRun("ThrowFromC(); throw 'panama';"); in THREADED_TEST()
5822 v8::Local<v8::Context> context = args.GetIsolate()->GetCurrentContext(); in CThrowCountDown()
5829 Local<v8::Object> global = context->Global(); in CThrowCountDown()
5830 Local<Value> fun = in CThrowCountDown()
5832 v8::Local<Value> argv[] = {v8_num(count - 1), args[1], args[2], args[3]}; in CThrowCountDown()
5835 Local<Value> result = fun.As<Function>() in CThrowCountDown()
5837 .FromMaybe(Local<Value>()); in CThrowCountDown()
5851 .FromMaybe(v8::Local<v8::Value>())); in CThrowCountDown()
5861 v8::Local<v8::Context> context = args.GetIsolate()->GetCurrentContext(); in JSCheck()
5912 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
5935 Local<Function> fun = Local<Function>::Cast( in TEST()
5937 ->Get(context.local(), v8_str("JSThrowCountDown")) in TEST()
5944 v8::Local<Value> a0[argc] = {v8_num(4), v8_num(2), v8_num(3), v8_num(2)}; in TEST()
5945 fun->Call(context.local(), fun, argc, a0).ToLocalChecked(); in TEST()
5948 v8::Local<Value> a1[argc] = {v8_num(5), v8_num(6), v8_num(1), v8_num(2)}; in TEST()
5949 fun->Call(context.local(), fun, argc, a1).ToLocalChecked(); in TEST()
5952 v8::Local<Value> a2[argc] = {v8_num(6), v8_num(7), v8_num(5), v8_num(5)}; in TEST()
5953 fun->Call(context.local(), fun, argc, a2).ToLocalChecked(); in TEST()
5956 v8::Local<Value> a3[argc] = {v8_num(6), v8_num(6), v8_num(7), v8_num(6)}; in TEST()
5957 fun->Call(context.local(), fun, argc, a3).ToLocalChecked(); in TEST()
5960 v8::Local<Value> a4[argc] = {v8_num(6), v8_num(4), v8_num(5), v8_num(4)}; in TEST()
5961 fun->Call(context.local(), fun, argc, a4).ToLocalChecked(); in TEST()
5964 v8::Local<Value> a5[argc] = {v8_num(6), v8_num(4), v8_num(3), v8_num(3)}; in TEST()
5965 fun->Call(context.local(), fun, argc, a5).ToLocalChecked(); in TEST()
5979 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
5982 v8::Local<v8::Array> result = v8::Local<v8::Array>::Cast( in THREADED_TEST()
5993 CHECK(result->Get(context.local(), v8::Integer::New(isolate, 0)) in THREADED_TEST()
5996 CHECK(result->Get(context.local(), v8::Integer::New(isolate, 1)) in THREADED_TEST()
5999 CHECK_EQ(1, result->Get(context.local(), v8::Integer::New(isolate, 1)) in THREADED_TEST()
6001 ->Int32Value(context.local()) in THREADED_TEST()
6003 CHECK(result->Get(context.local(), v8::Integer::New(isolate, 2)) in THREADED_TEST()
6006 CHECK_EQ(0, result->Get(context.local(), v8::Integer::New(isolate, 2)) in THREADED_TEST()
6008 ->Int32Value(context.local()) in THREADED_TEST()
6010 CHECK(result->Get(context.local(), v8::Integer::New(isolate, 3)) in THREADED_TEST()
6013 CHECK(result->Get(context.local(), v8::Integer::New(isolate, 4)) in THREADED_TEST()
6026 CHECK_EQ(10, try_catch.Exception()->Int32Value(context.local()).FromJust()); in THREADED_TEST()
6031 CHECK_EQ(0, try_catch.Exception()->Int32Value(context.local()).FromJust()); in THREADED_TEST()
6066 ->Set(context.local(), v8_str("native_with_try_catch"), in THREADED_TEST()
6068 ->GetFunction(context.local()) in THREADED_TEST()
6134 Local<Message> message = try_catch->Message(); in TryCatchMixedNestingCheck()
6135 Local<Value> resource = message->GetScriptOrigin().ResourceName(); in TryCatchMixedNestingCheck()
6167 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
6189 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
6214 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
6228 CHECK(v8_str("a")->Equals(context.local(), v8_str("a")).FromJust()); in THREADED_TEST()
6229 CHECK(!v8_str("a")->Equals(context.local(), v8_str("b")).FromJust()); in THREADED_TEST()
6231 CHECK(v8_str("a")->Equals(context.local(), v8_str("a")).FromJust()); in THREADED_TEST()
6232 CHECK(!v8_str("a")->Equals(context.local(), v8_str("b")).FromJust()); in THREADED_TEST()
6233 CHECK(v8_num(1)->Equals(context.local(), v8_num(1)).FromJust()); in THREADED_TEST()
6234 CHECK(v8_num(1.00)->Equals(context.local(), v8_num(1)).FromJust()); in THREADED_TEST()
6235 CHECK(!v8_num(1)->Equals(context.local(), v8_num(2)).FromJust()); in THREADED_TEST()
6244 Local<Value> not_a_number = v8_num(std::numeric_limits<double>::quiet_NaN()); in THREADED_TEST()
6249 v8::Local<v8::Object> obj = v8::Object::New(isolate); in THREADED_TEST()
6251 CHECK(v8::Local<v8::Object>::New(isolate, alias)->StrictEquals(obj)); in THREADED_TEST()
6269 Local<Script> script = v8_compile("x"); in THREADED_TEST()
6271 script->Run(context.local()).IsEmpty(); in THREADED_TEST()
6276 static void GetXValue(Local<Name> name, in GetXValue()
6292 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
6295 ->Set(context.local(), v8_str("obj"), in THREADED_TEST()
6296 templ->NewInstance(context.local()).ToLocalChecked()) in THREADED_TEST()
6298 Local<Script> script = v8_compile("obj.x"); in THREADED_TEST()
6300 Local<Value> result = script->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
6301 CHECK(result->Equals(context.local(), v8_str("x")).FromJust()); in THREADED_TEST()
6310 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
6313 ->Set(context.local(), v8_str("obj"), in THREADED_TEST()
6314 templ->NewInstance(context.local()).ToLocalChecked()) in THREADED_TEST()
6318 Local<Script> script_desc = v8_compile( in THREADED_TEST()
6322 Local<Value> result = script_desc->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
6323 CHECK_EQ(result->BooleanValue(context.local()).FromJust(), true); in THREADED_TEST()
6326 Local<Script> script_define = v8_compile( in THREADED_TEST()
6331 result = script_define->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
6332 CHECK(result->Equals(context.local(), v8_num(42)).FromJust()); in THREADED_TEST()
6335 result = script_desc->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
6336 CHECK_EQ(result->BooleanValue(context.local()).FromJust(), true); in THREADED_TEST()
6344 result = script_define->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
6345 CHECK(result->Equals(context.local(), v8_num(43)).FromJust()); in THREADED_TEST()
6346 result = script_desc->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
6347 CHECK_EQ(result->BooleanValue(context.local()).FromJust(), false); in THREADED_TEST()
6351 CHECK(script_define->Run(context.local()).IsEmpty()); in THREADED_TEST()
6362 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
6366 ->Set(context.local(), v8_str("obj"), in THREADED_TEST()
6367 templ->NewInstance(context.local()).ToLocalChecked()) in THREADED_TEST()
6370 Local<Script> script_desc = v8_compile( in THREADED_TEST()
6375 Local<Value> result = script_desc->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
6376 CHECK_EQ(result->BooleanValue(context.local()).FromJust(), true); in THREADED_TEST()
6378 Local<Script> script_define = v8_compile( in THREADED_TEST()
6383 result = script_define->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
6384 CHECK(result->Equals(context.local(), v8_num(42)).FromJust()); in THREADED_TEST()
6386 result = script_desc->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
6387 CHECK_EQ(result->BooleanValue(context.local()).FromJust(), true); in THREADED_TEST()
6394 result = script_define->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
6395 CHECK(result->Equals(context.local(), v8_num(43)).FromJust()); in THREADED_TEST()
6397 result = script_desc->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
6398 CHECK_EQ(result->BooleanValue(context.local()).FromJust(), false); in THREADED_TEST()
6401 CHECK(script_define->Run(context.local()).IsEmpty()); in THREADED_TEST()
6409 static v8::Local<v8::Object> GetGlobalProperty(LocalContext* context, in GetGlobalProperty()
6411 return v8::Local<v8::Object>::Cast( in GetGlobalProperty()
6422 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
6426 ->Set(context.local(), v8_str("obj1"), in THREADED_TEST()
6427 templ->NewInstance(context.local()).ToLocalChecked()) in THREADED_TEST()
6435 ->SetAccessor(context.local(), v8_str("x"), GetXValue, NULL, in THREADED_TEST()
6443 ->SetAccessor(context.local(), v8_str("x"), GetXValue, NULL, in THREADED_TEST()
6471 ->SetAccessor(context.local(), v8_str("x"), GetXValue, NULL, in THREADED_TEST()
6475 ->SetAccessor(context.local(), v8_str("x"), GetXValue, NULL, in THREADED_TEST()
6499 ->SetAccessor(context.local(), v8_str("x"), GetXValue, NULL, in THREADED_TEST()
6503 ->SetAccessor(context.local(), v8_str("x"), GetXValue, NULL, in THREADED_TEST()
6515 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
6519 ->Set(context.local(), v8_str("obj1"), in THREADED_TEST()
6520 templ->NewInstance(context.local()).ToLocalChecked()) in THREADED_TEST()
6525 ->SetAccessor(context.local(), v8_str("x"), GetXValue, NULL, in THREADED_TEST()
6529 ->SetAccessor(context.local(), v8_str("x"), GetXValue, NULL, in THREADED_TEST()
6540 ->SetAccessor(context.local(), v8_str("x"), GetXValue, NULL, in THREADED_TEST()
6544 ->SetAccessor(context.local(), v8_str("x"), GetXValue, NULL, in THREADED_TEST()
6571 static void Get239Value(Local<Name> name, in Get239Value()
6586 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
6590 ->Set(context.local(), v8_str("obj1"), in THREADED_TEST()
6591 templ->NewInstance(context.local()).ToLocalChecked()) in THREADED_TEST()
6596 ->SetAccessor(context.local(), v8_str("239"), Get239Value, NULL, in THREADED_TEST()
6600 ->SetAccessor(context.local(), v8_str("239"), Get239Value, NULL, in THREADED_TEST()
6614 static void SetXValue(Local<Name> name, Local<Value> value, in SetXValue()
6616 Local<Context> context = info.GetIsolate()->GetCurrentContext(); in SetXValue()
6628 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
6632 ->Set(context.local(), v8_str("obj"), in THREADED_TEST()
6633 templ->NewInstance(context.local()).ToLocalChecked()) in THREADED_TEST()
6635 Local<Script> script = v8_compile("obj.x = 4"); in THREADED_TEST()
6638 script->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
6640 ->Equals(context.local(), in THREADED_TEST()
6641 Local<Value>::New(CcTest::isolate(), xValue)) in THREADED_TEST()
6651 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
6655 ->Set(context.local(), v8_str("obj"), in THREADED_TEST()
6656 templ->NewInstance(context.local()).ToLocalChecked()) in THREADED_TEST()
6658 Local<Script> script = v8_compile("obj.x = 4; obj.x"); in THREADED_TEST()
6661 script->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
6663 ->Equals(context.local(), in THREADED_TEST()
6664 Local<Value>::New(CcTest::isolate(), xValue)) in THREADED_TEST()
6674 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
6679 ->Set(context.local(), v8_str("obj"), in THREADED_TEST()
6680 templ->NewInstance(context.local()).ToLocalChecked()) in THREADED_TEST()
6682 Local<Script> script = v8_compile("obj.x = 4; obj.x"); in THREADED_TEST()
6684 script->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
6692 v8::Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
6696 Local<String> password = v8_str("Password"); in THREADED_TEST()
6701 v8::Local<v8::Object> global0 = context0->Global(); in THREADED_TEST()
6702 CHECK(global0->Set(context0.local(), v8_str("custom"), v8_num(1234)) in THREADED_TEST()
6704 CHECK_EQ(1234, global0->Get(context0.local(), v8_str("custom")) in THREADED_TEST()
6706 ->Int32Value(context0.local()) in THREADED_TEST()
6712 v8::Local<v8::Object> global1 = context1->Global(); in THREADED_TEST()
6713 CHECK(global1->Set(context1.local(), v8_str("custom"), v8_num(1234)) in THREADED_TEST()
6715 CHECK(!global0->Equals(context1.local(), global1).FromJust()); in THREADED_TEST()
6716 CHECK_EQ(1234, global0->Get(context1.local(), v8_str("custom")) in THREADED_TEST()
6718 ->Int32Value(context0.local()) in THREADED_TEST()
6720 CHECK_EQ(1234, global1->Get(context1.local(), v8_str("custom")) in THREADED_TEST()
6722 ->Int32Value(context1.local()) in THREADED_TEST()
6728 v8::Local<v8::Object> global2 = context2->Global(); in THREADED_TEST()
6729 CHECK(global1->Equals(context2.local(), global2).FromJust()); in THREADED_TEST()
6730 CHECK_EQ(0, global1->Get(context2.local(), v8_str("custom")) in THREADED_TEST()
6732 ->Int32Value(context1.local()) in THREADED_TEST()
6734 CHECK_EQ(0, global2->Get(context2.local(), v8_str("custom")) in THREADED_TEST()
6736 ->Int32Value(context2.local()) in THREADED_TEST()
6748 v8::Local<v8::Object> global0 = env0->Global(); in THREADED_TEST()
6749 v8::Local<v8::Object> object0 = global0->Get(env0.local(), v8_str("Object")) in THREADED_TEST()
6752 v8::Local<v8::Object> tostring0 = in THREADED_TEST()
6753 object0->Get(env0.local(), v8_str("toString")) in THREADED_TEST()
6756 v8::Local<v8::Object> proto0 = in THREADED_TEST()
6757 tostring0->Get(env0.local(), v8_str("__proto__")) in THREADED_TEST()
6760 CHECK(proto0->Set(env0.local(), v8_str("custom"), v8_num(1234)).FromJust()); in THREADED_TEST()
6763 v8::Local<v8::Object> global1 = env1->Global(); in THREADED_TEST()
6764 v8::Local<v8::Object> object1 = global1->Get(env1.local(), v8_str("Object")) in THREADED_TEST()
6767 v8::Local<v8::Object> tostring1 = in THREADED_TEST()
6768 object1->Get(env1.local(), v8_str("toString")) in THREADED_TEST()
6771 v8::Local<v8::Object> proto1 = in THREADED_TEST()
6772 tostring1->Get(env1.local(), v8_str("__proto__")) in THREADED_TEST()
6775 CHECK(!proto1->Has(env1.local(), v8_str("custom")).FromJust()); in THREADED_TEST()
6788 Local<String> source = v8_str( in THREADED_TEST()
6794 Local<Script> script0 = v8_compile(source); in THREADED_TEST()
6795 CHECK_EQ(8901.0, script0->Run(env0.local()) in THREADED_TEST()
6797 ->NumberValue(env0.local()) in THREADED_TEST()
6801 Local<Script> script1 = v8_compile(source); in THREADED_TEST()
6802 CHECK_EQ(8901.0, script1->Run(env1.local()) in THREADED_TEST()
6804 ->NumberValue(env1.local()) in THREADED_TEST()
6813 Local<v8::FunctionTemplate> desc = in THREADED_TEST()
6817 Local<v8::Object> obj = desc->GetFunction(env.local()) in THREADED_TEST()
6819 ->NewInstance(env.local()) in THREADED_TEST()
6822 env->Global()->Set(env.local(), v8_str("undetectable"), obj).FromJust()); in THREADED_TEST()
6862 Local<v8::FunctionTemplate> desc = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
6865 Local<v8::Object> obj = desc->GetFunction(env.local()) in THREADED_TEST()
6867 ->NewInstance(env.local()) in THREADED_TEST()
6870 env->Global()->Set(env.local(), v8_str("undetectable"), obj).FromJust()); in THREADED_TEST()
6912 Local<v8::FunctionTemplate> desc = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
6915 Local<v8::Object> obj = desc->GetFunction(env.local()) in THREADED_TEST()
6917 ->NewInstance(env.local()) in THREADED_TEST()
6920 env->Global()->Set(env.local(), v8_str("undetectable"), obj).FromJust()); in THREADED_TEST()
6922 Local<String> source = v8_str( in THREADED_TEST()
6926 Local<Script> script = v8_compile(source); in THREADED_TEST()
6929 ->Equals(env.local(), script->Run(env.local()).ToLocalChecked()) in THREADED_TEST()
6936 script->Run(env.local()).ToLocalChecked(); in THREADED_TEST()
6941 script->Run(env.local()).ToLocalChecked(); in THREADED_TEST()
6952 Local<String> str = v8_str("foo"); in TEST()
6955 Local<Script> scr = v8_compile(""); in TEST()
6958 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
6973 Local<ObjectTemplate> global_template = ObjectTemplate::New(isolate); in THREADED_TEST()
6976 v8::Local<Context> context = Context::New(isolate, 0, global_template); in THREADED_TEST()
6993 v8::Local<Context> context = Context::New(CcTest::isolate(), &extensions); in TEST()
6995 v8::Local<Value> result = CompileRun("Foo()"); in TEST()
7016 v8::Local<Context> context = Context::New(CcTest::isolate(), &extensions); in TEST()
7033 v8::Local<Context> context = Context::New(CcTest::isolate(), &extensions); in TEST()
7035 v8::Local<Value> result = CompileRun("1+3"); in TEST()
7053 v8::Local<Context> context = Context::New(CcTest::isolate(), &extensions); in TEST()
7068 v8::Local<Context> context = Context::New(CcTest::isolate(), &extensions); in TEST()
7071 v8::Local<Value> result = CompileRun("Ret54321()"); in TEST()
7106 v8::Local<Context> context = Context::New(CcTest::isolate(), &extensions); in TEST()
7108 v8::Local<Value> result = CompileRun("UseEval1()"); in TEST()
7140 v8::Local<Context> context = Context::New(CcTest::isolate(), &extensions); in TEST()
7142 v8::Local<Value> result = CompileRun("UseWith1()"); in TEST()
7156 v8::Local<Context> context = Context::New(CcTest::isolate()); in TEST()
7158 v8::Local<Value> result = CompileRun("Foo()"); in TEST()
7175 v8::Local<Context> context = Context::New(CcTest::isolate(), &extensions); in TEST()
7191 v8::Local<Context> context = Context::New(CcTest::isolate(), &extensions); in TEST()
7212 v8::Local<Context> context = Context::New(CcTest::isolate(), &extensions); in TEST()
7214 v8::Local<Value> result = CompileRun(kNativeCallTest); in TEST()
7226 virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate( in GetNativeFunctionTemplate()
7227 v8::Isolate* isolate, v8::Local<v8::String> name) { in GetNativeFunctionTemplate()
7247 v8::Local<Context> context = Context::New(CcTest::isolate(), &extensions); in TEST()
7249 v8::Local<Value> result = CompileRun("foo(42);"); in TEST()
7263 v8::Local<Context> context = Context::New(CcTest::isolate(), &extensions); in TEST()
7277 v8::Local<Context> context = Context::New(CcTest::isolate(), &extensions); in TEST()
7288 ->Equals(context.local(), context->Global() in CheckDependencies()
7289 ->Get(context.local(), v8_str("loaded")) in CheckDependencies()
7322 ->Equals(context.local(), context->Global() in THREADED_TEST()
7323 ->Get(context.local(), v8_str("loaded")) in THREADED_TEST()
7357 virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
7358 v8::Isolate* isolate, v8::Local<String> name);
7363 v8::Local<v8::FunctionTemplate> FunctionExtension::GetNativeFunctionTemplate( in GetNativeFunctionTemplate()
7364 v8::Isolate* isolate, v8::Local<String> name) { in GetNativeFunctionTemplate()
7378 return v8::Local<v8::FunctionTemplate>(); in GetNativeFunctionTemplate()
7391 ->Equals(context.local(), CompileRun("Foo(0)")) in THREADED_TEST()
7394 ->Equals(context.local(), CompileRun("Foo(1)")) in THREADED_TEST()
7397 ->Equals(context.local(), CompileRun("Foo(2)")) in THREADED_TEST()
7412 ->Equals(context.local(), CompileRun("(new A()).data")) in THREADED_TEST()
7415 ->Equals(context.local(), CompileRun("(new B()).data")) in THREADED_TEST()
7418 ->Equals(context.local(), CompileRun("(new C()).data")) in THREADED_TEST()
7445 v8::Local<Context> context = Context::New(CcTest::isolate(), &config); in TEST()
7451 static void MissingScriptInfoMessageListener(v8::Local<v8::Message> message, in MissingScriptInfoMessageListener()
7452 v8::Local<Value> data) { in MissingScriptInfoMessageListener()
7454 Local<Context> context = isolate->GetCurrentContext(); in MissingScriptInfoMessageListener()
7489 v8::Local<Context> context = Context::New(iso); in IndependentWeakHandle()
7498 Local<Object> a(v8::Object::New(iso)); in IndependentWeakHandle()
7499 Local<Object> b(v8::Object::New(iso)); in IndependentWeakHandle()
7513 v8::Local<Value> big_array = CompileRun("new Array(5000)"); in IndependentWeakHandle()
7595 Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate); in InternalFieldCallback()
7596 Local<v8::ObjectTemplate> instance_templ = templ->InstanceTemplate(); in InternalFieldCallback()
7602 Local<v8::Object> obj = templ->GetFunction(env.local()) in InternalFieldCallback()
7604 ->NewInstance(env.local()) in InternalFieldCallback()
7658 using v8::Local; in ResetWeakHandle()
7663 v8::Local<Context> context = Context::New(iso); in ResetWeakHandle()
7670 Local<Object> a(v8::Object::New(iso)); in ResetWeakHandle()
7671 Local<Object> b(v8::Object::New(iso)); in ResetWeakHandle()
7744 v8::Local<Context> context = Context::New(isolate); in THREADED_TEST()
7774 v8::Local<Function> args_fun;
7781 Local<Context> context = isolate->GetCurrentContext(); in ArgumentsTestCallback()
7796 v8::Local<v8::ObjectTemplate> global = ObjectTemplate::New(isolate); in THREADED_TEST()
7801 ->Get(context.local(), v8_str("f")) in THREADED_TEST()
7804 v8_compile("f(1, 2, 3)")->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
7812 static void PGetter(Local<Name> name, in PGetter()
7816 v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext(); in PGetter()
7817 v8::Local<v8::Object> global = context->Global(); in PGetter()
7846 static void RunHolderTest(v8::Local<v8::ObjectTemplate> obj) { in RunHolderTest()
7850 ->Set(context.local(), v8_str("o1"), in RunHolderTest()
7851 obj->NewInstance(context.local()).ToLocalChecked()) in RunHolderTest()
7865 static void PGetter2(Local<Name> name, in PGetter2()
7869 v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext(); in PGetter2()
7870 v8::Local<v8::Object> global = context->Global(); in PGetter2()
7902 v8::Local<v8::ObjectTemplate> obj = ObjectTemplate::New(isolate); in THREADED_TEST()
7916 v8::Local<v8::ObjectTemplate> obj = ObjectTemplate::New(isolate); in THREADED_TEST()
7927 v8::Local<v8::ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
7931 ->Set(context.local(), v8_str("o"), in THREADED_TEST()
7932 templ->NewInstance(context.local()).ToLocalChecked()) in THREADED_TEST()
7936 v8::Local<v8::Object> obj = in THREADED_TEST()
7937 templ->NewInstance(context.local()).ToLocalChecked(); in THREADED_TEST()
7938 CHECK(!obj->Equals(context.local(), context->Global() in THREADED_TEST()
7939 ->Get(context.local(), v8_str("o")) in THREADED_TEST()
7943 context->Global()->Set(context.local(), v8_str("o2"), obj).FromJust()); in THREADED_TEST()
7944 v8::Local<Value> value = CompileRun("o.__proto__ === o2.__proto__"); in THREADED_TEST()
7945 CHECK(v8::True(isolate)->Equals(context.local(), value).FromJust()); in THREADED_TEST()
7946 CHECK(context->Global()->Set(context.local(), v8_str("o"), obj).FromJust()); in THREADED_TEST()
7972 int GetUtf8Length(Local<String> str) { in GetUtf8Length()
7986 v8::Local<String> str = v8_str("abcde"); in THREADED_TEST()
7988 v8::Local<String> str2 = v8_str("abc\303\260\342\230\203"); in THREADED_TEST()
7989 v8::Local<String> str3 = in THREADED_TEST()
7995 v8::Local<String> orphans_str = in THREADED_TEST()
8001 v8::Local<String> lead_str = in THREADED_TEST()
8007 v8::Local<String> trail_str = in THREADED_TEST()
8013 v8::Local<String> pair_str = in THREADED_TEST()
8028 v8::Local<v8::Object> global = context->Global(); in THREADED_TEST()
8029 Local<String> left_tree = global->Get(context.local(), v8_str("left")) in THREADED_TEST()
8032 Local<String> right_tree = global->Get(context.local(), v8_str("right")) in THREADED_TEST()
8310 Local<v8::Array> a = Local<v8::Array>::Cast( in Utf16Helper()
8311 context->Global()->Get(context.local(), v8_str(name)).ToLocalChecked()); in Utf16Helper()
8312 Local<v8::Array> alens = in Utf16Helper()
8313 Local<v8::Array>::Cast(context->Global() in Utf16Helper()
8314 ->Get(context.local(), v8_str(lengths_name)) in Utf16Helper()
8317 Local<v8::String> string = in Utf16Helper()
8318 Local<v8::String>::Cast(a->Get(context.local(), i).ToLocalChecked()); in Utf16Helper()
8319 Local<v8::Number> expected_len = Local<v8::Number>::Cast( in Utf16Helper()
8320 alens->Get(context.local(), i).ToLocalChecked()); in Utf16Helper()
8376 static bool SameSymbol(Local<String> s1, Local<String> s2) { in SameSymbol()
8387 Local<String> symbol1 = in THREADED_TEST()
8391 Local<String> symbol2 = in THREADED_TEST()
8412 Local<String> sym0 = in THREADED_TEST()
8416 Local<String> sym0b = in THREADED_TEST()
8420 Local<String> sym1 = in THREADED_TEST()
8424 Local<String> sym2 = in THREADED_TEST()
8428 Local<String> sym3 = v8::String::NewFromUtf8(context->GetIsolate(), in THREADED_TEST()
8432 Local<String> sym4 = in THREADED_TEST()
8436 v8::Local<v8::Object> global = context->Global(); in THREADED_TEST()
8437 Local<Value> s0 = in THREADED_TEST()
8438 global->Get(context.local(), v8_str("sym0")).ToLocalChecked(); in THREADED_TEST()
8439 Local<Value> s0b = in THREADED_TEST()
8440 global->Get(context.local(), v8_str("sym0b")).ToLocalChecked(); in THREADED_TEST()
8441 Local<Value> s1 = in THREADED_TEST()
8442 global->Get(context.local(), v8_str("sym1")).ToLocalChecked(); in THREADED_TEST()
8443 Local<Value> s2 = in THREADED_TEST()
8444 global->Get(context.local(), v8_str("sym2")).ToLocalChecked(); in THREADED_TEST()
8445 Local<Value> s3 = in THREADED_TEST()
8446 global->Get(context.local(), v8_str("sym3")).ToLocalChecked(); in THREADED_TEST()
8447 Local<Value> s4 = in THREADED_TEST()
8448 global->Get(context.local(), v8_str("sym4")).ToLocalChecked(); in THREADED_TEST()
8449 CHECK(SameSymbol(sym0, Local<String>::Cast(s0))); in THREADED_TEST()
8450 CHECK(SameSymbol(sym0b, Local<String>::Cast(s0b))); in THREADED_TEST()
8451 CHECK(SameSymbol(sym1, Local<String>::Cast(s1))); in THREADED_TEST()
8452 CHECK(SameSymbol(sym2, Local<String>::Cast(s2))); in THREADED_TEST()
8453 CHECK(SameSymbol(sym3, Local<String>::Cast(s3))); in THREADED_TEST()
8454 CHECK(SameSymbol(sym4, Local<String>::Cast(s4))); in THREADED_TEST()
8473 v8::Local<v8::String> str = in THREADED_TEST()
8496 v8::Local<v8::String> str = in THREADED_TEST()
8514 v8::Local<String> str = v8_str("42"); in THREADED_TEST()
8515 v8::MaybeLocal<v8::Uint32> index = str->ToArrayIndex(context.local()); in THREADED_TEST()
8518 index.ToLocalChecked()->Uint32Value(context.local()).FromJust()); in THREADED_TEST()
8520 index = str->ToArrayIndex(context.local()); in THREADED_TEST()
8523 index = str->ToArrayIndex(context.local()); in THREADED_TEST()
8526 index = str->ToArrayIndex(context.local()); in THREADED_TEST()
8529 index.ToLocalChecked()->Uint32Value(context.local()).FromJust()); in THREADED_TEST()
8530 v8::Local<v8::Number> num = v8::Number::New(isolate, 1); in THREADED_TEST()
8531 index = num->ToArrayIndex(context.local()); in THREADED_TEST()
8534 index.ToLocalChecked()->Uint32Value(context.local()).FromJust()); in THREADED_TEST()
8536 index = num->ToArrayIndex(context.local()); in THREADED_TEST()
8538 v8::Local<v8::Object> obj = v8::Object::New(isolate); in THREADED_TEST()
8539 index = obj->ToArrayIndex(context.local()); in THREADED_TEST()
8548 v8::Local<String> foo = v8_str("foo"); in THREADED_TEST()
8549 v8::Local<String> message = v8_str("message"); in THREADED_TEST()
8550 v8::Local<Value> range_error = v8::Exception::RangeError(foo); in THREADED_TEST()
8553 ->Get(context.local(), message) in THREADED_TEST()
8555 ->Equals(context.local(), foo) in THREADED_TEST()
8557 v8::Local<Value> reference_error = v8::Exception::ReferenceError(foo); in THREADED_TEST()
8560 ->Get(context.local(), message) in THREADED_TEST()
8562 ->Equals(context.local(), foo) in THREADED_TEST()
8564 v8::Local<Value> syntax_error = v8::Exception::SyntaxError(foo); in THREADED_TEST()
8567 ->Get(context.local(), message) in THREADED_TEST()
8569 ->Equals(context.local(), foo) in THREADED_TEST()
8571 v8::Local<Value> type_error = v8::Exception::TypeError(foo); in THREADED_TEST()
8574 ->Get(context.local(), message) in THREADED_TEST()
8576 ->Equals(context.local(), foo) in THREADED_TEST()
8578 v8::Local<Value> error = v8::Exception::Error(foo); in THREADED_TEST()
8581 ->Get(context.local(), message) in THREADED_TEST()
8583 ->Equals(context.local(), foo) in THREADED_TEST()
8590 v8::Local<String> foo = v8_str("foo"); in ThrowV8Exception()
8591 v8::Local<String> message = v8_str("message"); in ThrowV8Exception()
8592 v8::Local<Value> error = v8::Exception::Error(foo); in ThrowV8Exception()
8594 v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext(); in ThrowV8Exception()
8608 v8::Local<String> foo_str = v8_str("foo"); in THREADED_TEST()
8609 v8::Local<String> message_str = v8_str("message"); in THREADED_TEST()
8613 Local<v8::FunctionTemplate> fun = in THREADED_TEST()
8615 v8::Local<v8::Object> global = context->Global(); in THREADED_TEST()
8616 CHECK(global->Set(context.local(), v8_str("throwV8Exception"), in THREADED_TEST()
8617 fun->GetFunction(context.local()).ToLocalChecked()) in THREADED_TEST()
8628 v8::Local<v8::Value> error = try_catch.Exception(); in THREADED_TEST()
8631 ->Get(context.local(), message_str) in THREADED_TEST()
8633 ->Equals(context.local(), foo_str) in THREADED_TEST()
8636 v8::Local<v8::Message> message = in THREADED_TEST()
8639 CHECK_EQ(2, message->GetLineNumber(context.local()).FromJust()); in THREADED_TEST()
8640 CHECK_EQ(2, message->GetStartColumn(context.local()).FromJust()); in THREADED_TEST()
8642 v8::Local<v8::StackTrace> stackTrace = message->GetStackTrace(); in THREADED_TEST()
8666 ->Get(context.local(), message_str) in THREADED_TEST()
8668 ->Equals(context.local(), foo_str) in THREADED_TEST()
8673 CHECK_EQ(2, message->GetLineNumber(context.local()).FromJust()); in THREADED_TEST()
8674 CHECK_EQ(9, message->GetStartColumn(context.local()).FromJust()); in THREADED_TEST()
8699 static void YGetter(Local<String> name, in YGetter()
8706 static void YSetter(Local<String> name, in YSetter()
8707 Local<Value> value, in YSetter()
8709 Local<Object> this_obj = Local<Object>::Cast(info.This()); in YSetter()
8710 v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext(); in YSetter()
8720 v8::Local<v8::ObjectTemplate> obj = ObjectTemplate::New(isolate); in THREADED_TEST()
8723 v8::Local<v8::Object> holder = in THREADED_TEST()
8724 obj->NewInstance(context.local()).ToLocalChecked(); in THREADED_TEST()
8726 ->Set(context.local(), v8_str("holder"), holder) in THREADED_TEST()
8728 v8::Local<Value> result = in THREADED_TEST()
8730 CHECK_EQ(12u, result->Uint32Value(context.local()).FromJust()); in THREADED_TEST()
8740 Local<v8::Context> context = args.GetIsolate()->GetCurrentContext(); in TroubleCallback()
8741 Local<v8::Object> arg_this = context->Global(); in TroubleCallback()
8742 Local<Value> trouble_callee = in TroubleCallback()
8749 .FromMaybe(v8::Local<v8::Value>())); in TroubleCallback()
8754 static void ApiUncaughtExceptionTestListener(v8::Local<v8::Message>, in ApiUncaughtExceptionTestListener()
8755 v8::Local<Value>) { in ApiUncaughtExceptionTestListener()
8769 Local<v8::FunctionTemplate> fun = in TEST()
8771 v8::Local<v8::Object> global = env->Global(); in TEST()
8772 CHECK(global->Set(env.local(), v8_str("trouble"), in TEST()
8773 fun->GetFunction(env.local()).ToLocalChecked()) in TEST()
8784 Local<Value> trouble = in TEST()
8785 global->Get(env.local(), v8_str("trouble")).ToLocalChecked(); in TEST()
8787 Local<Value> trouble_callee = in TEST()
8788 global->Get(env.local(), v8_str("trouble_callee")).ToLocalChecked(); in TEST()
8790 Local<Value> trouble_caller = in TEST()
8791 global->Get(env.local(), v8_str("trouble_caller")).ToLocalChecked(); in TEST()
8794 ->Call(env.local(), global, 0, NULL) in TEST()
8795 .FromMaybe(v8::Local<v8::Value>()); in TEST()
8829 static void ExceptionInNativeScriptTestListener(v8::Local<v8::Message> message, in ExceptionInNativeScriptTestListener()
8830 v8::Local<Value>) { in ExceptionInNativeScriptTestListener()
8831 v8::Local<v8::Value> name_val = message->GetScriptOrigin().ResourceName(); in ExceptionInNativeScriptTestListener()
8835 v8::Local<v8::Context> context = in ExceptionInNativeScriptTestListener()
8850 Local<v8::FunctionTemplate> fun = in TEST()
8852 v8::Local<v8::Object> global = env->Global(); in TEST()
8853 CHECK(global->Set(env.local(), v8_str("trouble"), in TEST()
8854 fun->GetFunction(env.local()).ToLocalChecked()) in TEST()
8863 Local<Value> trouble = in TEST()
8864 global->Get(env.local(), v8_str("trouble")).ToLocalChecked(); in TEST()
8866 CHECK(Function::Cast(*trouble)->Call(env.local(), global, 0, NULL).IsEmpty()); in TEST()
8914 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
8942 static bool SecurityTestCallback(Local<v8::Context> accessing_context, in SecurityTestCallback()
8943 Local<v8::Object> accessed_object) { in SecurityTestCallback()
8953 v8::Local<v8::ObjectTemplate> global_template = in TEST()
8957 v8::Local<Context> context0 = Context::New(isolate, NULL, global_template); in TEST()
8960 v8::Local<v8::Object> global0 = context0->Global(); in TEST()
8961 v8::Local<Script> script0 = v8_compile("foo = 111"); in TEST()
8964 v8::Local<Value> foo0 = in TEST()
8967 v8::Local<Value> z0 = global0->Get(context0, v8_str("0")).ToLocalChecked(); in TEST()
8973 v8::Local<Context> context1 = Context::New(isolate, NULL, global_template); in TEST()
8976 v8::Local<v8::Object> global1 = context1->Global(); in TEST()
8979 v8::Local<Script> script1 = in TEST()
8984 v8::Local<Value> foo1 = in TEST()
8988 v8::Local<Value> z1 = global0->Get(context1, v8_str("0")).ToLocalChecked(); in TEST()
8995 v8::Local<v8::Object> global2 = context2->Global(); in TEST()
8996 CHECK(global2->Set(context2.local(), v8_str("othercontext"), global0) in TEST()
8998 v8::Local<Script> script2 = in TEST()
9000 script2->Run(context2.local()).ToLocalChecked(); in TEST()
9001 v8::Local<Value> foo2 = in TEST()
9002 global0->Get(context2.local(), v8_str("foo")).ToLocalChecked(); in TEST()
9003 CHECK_EQ(333, foo2->Int32Value(context2.local()).FromJust()); in TEST()
9004 v8::Local<Value> z2 = in TEST()
9005 global0->Get(context2.local(), v8_str("0")).ToLocalChecked(); in TEST()
9006 CHECK_EQ(888, z2->Int32Value(context2.local()).FromJust()); in TEST()
9017 v8::Local<Context> env2 = Context::New(env1->GetIsolate()); in THREADED_TEST()
9019 Local<Value> foo = v8_str("foo"); in THREADED_TEST()
9020 Local<Value> bar = v8_str("bar"); in THREADED_TEST()
9027 Local<Value> spy = in THREADED_TEST()
9028 env1->Global()->Get(env1.local(), v8_str("spy")).ToLocalChecked(); in THREADED_TEST()
9033 Local<Value> spy2 = in THREADED_TEST()
9034 env1->Global()->Get(env1.local(), v8_str("spy2")).ToLocalChecked(); in THREADED_TEST()
9042 Local<Value> result = Function::Cast(*spy) in THREADED_TEST()
9064 v8::Local<Context> other = Context::New(current->GetIsolate()); in THREADED_TEST()
9068 v8::Local<Value> other_object; in THREADED_TEST()
9076 ->Set(current.local(), v8_str("other"), other->Global()) in THREADED_TEST()
9079 ->Run(current.local()) in THREADED_TEST()
9081 ->Equals(current.local(), other->Global()) in THREADED_TEST()
9087 v8::Local<Script> access_other0 = v8_compile("other.Object"); in THREADED_TEST()
9088 v8::Local<Script> access_other1 = v8_compile("other[42]"); in THREADED_TEST()
9090 CHECK(access_other0->Run(current.local()).IsEmpty()); in THREADED_TEST()
9091 CHECK(access_other1->Run(current.local()).IsEmpty()); in THREADED_TEST()
9101 ->Run(current.local()) in THREADED_TEST()
9103 v8::Local<Script> access_f0 = v8_compile("f.Object"); in THREADED_TEST()
9104 v8::Local<Script> access_f1 = v8_compile("f[42]"); in THREADED_TEST()
9106 CHECK(access_f0->Run(current.local()).IsEmpty()); in THREADED_TEST()
9107 CHECK(access_f1->Run(current.local()).IsEmpty()); in THREADED_TEST()
9122 ->Set(current.local(), v8_str("foo"), v8_num(100)) in THREADED_TEST()
9125 ->Set(current.local(), v8_num(99), v8_num(101)) in THREADED_TEST()
9129 Local<Script> access_f2 = v8_compile("f.foo"); in THREADED_TEST()
9130 Local<Script> access_f3 = v8_compile("f[99]"); in THREADED_TEST()
9132 CHECK(access_f2->Run(current.local()).IsEmpty()); in THREADED_TEST()
9133 CHECK(access_f3->Run(current.local()).IsEmpty()); in THREADED_TEST()
9140 static bool SecurityTestCallbackWithGC(Local<v8::Context> accessing_context, in SecurityTestCallbackWithGC()
9141 Local<v8::Object> accessed_object) { in SecurityTestCallbackWithGC()
9151 v8::Local<v8::ObjectTemplate> object_template = in TEST()
9155 v8::Local<Context> context = Context::New(isolate); in TEST()
9180 v8::Local<Context> env2 = Context::New(env1->GetIsolate()); in THREADED_TEST()
9182 Local<Value> foo = v8_str("foo"); in THREADED_TEST()
9183 Local<Value> bar = v8_str("bar"); in THREADED_TEST()
9190 env1->Global()->Set(env1.local(), v8_str("prop"), v8_num(3)).FromJust()); in THREADED_TEST()
9197 Local<Value> result = in THREADED_TEST()
9203 Local<Value> v = in THREADED_TEST()
9204 env1->Global()->Get(env1.local(), v8_str("prop")).ToLocalChecked(); in THREADED_TEST()
9206 CHECK_EQ(3, v->Int32Value(env1.local()).FromJust()); in THREADED_TEST()
9213 v8::Local<Context> env2 = Context::New(env1->GetIsolate()); in THREADED_TEST()
9215 Local<Value> foo = v8_str("foo"); in THREADED_TEST()
9216 Local<Value> bar = v8_str("bar"); in THREADED_TEST()
9223 env1->Global()->Set(env1.local(), v8_str("prop"), v8_num(3)).FromJust()); in THREADED_TEST()
9227 Local<String> test = v8_str("propertyIsEnumerable.call(env1, 'prop')"); in THREADED_TEST()
9230 Local<Value> result = CompileRun(test); in THREADED_TEST()
9238 Local<Value> result = CompileRun(test); in THREADED_TEST()
9247 v8::Local<Context> env2 = Context::New(env1->GetIsolate()); in THREADED_TEST()
9249 Local<Value> foo = v8_str("foo"); in THREADED_TEST()
9250 Local<Value> bar = v8_str("bar"); in THREADED_TEST()
9257 env1->Global()->Set(env1.local(), v8_str("prop"), v8_num(3)).FromJust()); in THREADED_TEST()
9267 Local<Value> result = CompileRun( in THREADED_TEST()
9286 v8::Local<Context> env2 = Context::New(env1->GetIsolate()); in THREADED_TEST()
9288 Local<Value> foo = v8_str("foo"); in THREADED_TEST()
9289 Local<Value> bar = v8_str("bar"); in THREADED_TEST()
9296 env1->Global()->Set(env1.local(), v8_str("prop"), v8_num(3)).FromJust()); in THREADED_TEST()
9306 Local<Value> result = CompileRun( in THREADED_TEST()
9326 v8::Local<Context> env2 = Context::New(env1->GetIsolate()); in TEST()
9329 Local<Value> foo = v8_str("foo"); in TEST()
9339 Local<v8::Object> global2 = env2->Global(); in TEST()
9346 ->Set(env1.local(), v8_str("getProp"), in TEST()
9354 v8::Local<Context> env3 = Context::New( in TEST()
9355 env1->GetIsolate(), 0, v8::Local<v8::ObjectTemplate>(), global2); in TEST()
9359 Local<v8::Object> global3 = env3->Global(); in TEST()
9373 Local<v8::Object> global1 = env1->Global(); in TEST()
9374 Local<Value> get_prop = in TEST()
9375 global1->Get(env1.local(), v8_str("getProp")).ToLocalChecked(); in TEST()
9378 Local<Value> r = Function::Cast(*get_prop) in TEST()
9379 ->Call(env1.local(), global1, 0, NULL) in TEST()
9382 CHECK_EQ(1, r->Int32Value(env1.local()).FromJust()); in TEST()
9387 v8::MaybeLocal<Value> r = global3->Get(env1.local(), v8_str("prop2")); in TEST()
9398 v8::Local<Context> env2 = Context::New(env1->GetIsolate()); in TEST()
9400 Local<Value> foo = v8_str("foo"); in TEST()
9416 ->Set(env1.local(), v8_str("other"), env2->Global()) in TEST()
9420 Local<Value> result = CompileRun("other.p"); in TEST()
9422 CHECK_EQ(42, result->Int32Value(env1.local()).FromJust()); in TEST()
9425 Local<v8::Object> global2 = env2->Global(); in TEST()
9434 v8::Local<Context> env3 = Context::New( in TEST()
9435 env1->GetIsolate(), 0, v8::Local<v8::ObjectTemplate>(), global2); in TEST()
9436 CHECK(global2->Equals(env1.local(), env3->Global()).FromJust()); in TEST()
9466 v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext(); in GetThisX()
9477 Local<ObjectTemplate> inner_global_template = in TEST()
9481 v8::Local<Context> env2 = in TEST()
9484 Local<Value> foo = v8_str("foo"); in TEST()
9491 ->Set(env1.local(), v8_str("x"), v8_str("env1_x")) in TEST()
9502 ->Set(env1.local(), v8_str("bound_x"), CompileRun("bound_x")) in TEST()
9505 ->Set(env1.local(), v8_str("get_x"), CompileRun("get_x")) in TEST()
9508 ->Set(env1.local(), v8_str("get_x_w"), CompileRun("get_x_w")) in TEST()
9511 ->Set(env1.local(), v8_str("this_x"), in TEST()
9516 Local<Object> env2_global = env2->Global(); in TEST()
9519 Local<Value> result; in TEST()
9521 CHECK(v8_str("env2_x")->Equals(env1.local(), result).FromJust()); in TEST()
9527 CHECK(v8_str("env2_x")->Equals(env1.local(), result).FromJust()); in TEST()
9530 env2 = Context::New(env1->GetIsolate(), 0, v8::Local<v8::ObjectTemplate>(), in TEST()
9546 Local<v8::Array> results = Local<v8::Array>::Cast(result); in TEST()
9573 Local<v8::Array> results = Local<v8::Array>::Cast(result); in TEST()
9577 ->Equals(env1.local(), in TEST()
9578 results->Get(env1.local(), i + 0).ToLocalChecked()) in TEST()
9581 ->Equals(env1.local(), in TEST()
9582 results->Get(env1.local(), i + 1).ToLocalChecked()) in TEST()
9585 ->Equals(env1.local(), in TEST()
9586 results->Get(env1.local(), i + 2).ToLocalChecked()) in TEST()
9589 ->Equals(env1.local(), in TEST()
9590 results->Get(env1.local(), i + 3).ToLocalChecked()) in TEST()
9603 results = Local<v8::Array>::Cast(result); in TEST()
9607 ->Equals(env1.local(), in TEST()
9608 results->Get(env1.local(), i + 0).ToLocalChecked()) in TEST()
9611 ->Equals(env1.local(), in TEST()
9612 results->Get(env1.local(), i + 1).ToLocalChecked()) in TEST()
9615 ->Equals(env1.local(), in TEST()
9616 results->Get(env1.local(), i + 2).ToLocalChecked()) in TEST()
9619 ->Equals(env1.local(), in TEST()
9620 results->Get(env1.local(), i + 3).ToLocalChecked()) in TEST()
9627 static bool AccessBlocker(Local<v8::Context> accessing_context, in AccessBlocker()
9628 Local<v8::Object> accessed_object) { in AccessBlocker()
9629 v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext(); in AccessBlocker()
9639 Local<String> name, in EchoGetter()
9645 static void EchoSetter(Local<String> name, Local<Value> value, in EchoSetter()
9654 Local<String> name, in UnreachableGetter()
9660 static void UnreachableSetter(Local<String>, in UnreachableSetter()
9661 Local<Value>, in UnreachableSetter()
9676 v8::Local<v8::ObjectTemplate> global_template = in TEST()
9683 v8_str("accessible_prop"), EchoGetter, EchoSetter, v8::Local<Value>(), in TEST()
9689 UnreachableSetter, v8::Local<Value>(), in TEST()
9700 v8::Local<Context> context0 = Context::New(isolate, NULL, global_template); in TEST()
9703 v8::Local<v8::Object> global0 = context0->Global(); in TEST()
9711 Local<Value> getter = in TEST()
9713 Local<Value> setter = in TEST()
9725 Local<Value> el_getter = in TEST()
9727 Local<Value> el_setter = in TEST()
9732 v8::Local<Context> context1 = Context::New(isolate); in TEST()
9735 v8::Local<v8::Object> global1 = context1->Global(); in TEST()
9793 v8::Local<Value> value; in TEST()
9853 v8::Local<v8::ObjectTemplate> global_template = in TEST()
9860 v8_str("accessible_prop"), EchoGetter, EchoSetter, v8::Local<Value>(), in TEST()
9866 UnreachableSetter, v8::Local<Value>(), in TEST()
9870 v8::Local<Context> context0 = Context::New(isolate, NULL, global_template); in TEST()
9873 v8::Local<v8::Object> global0 = context0->Global(); in TEST()
9875 v8::Local<Context> context1 = Context::New(isolate); in TEST()
9877 v8::Local<v8::Object> global1 = context1->Global(); in TEST()
9923 static bool AccessAlwaysBlocked(Local<v8::Context> accessing_context, in AccessAlwaysBlocked()
9924 Local<v8::Object> global) { in AccessAlwaysBlocked()
9933 v8::Local<v8::ObjectTemplate> obj_template = v8::ObjectTemplate::New(isolate); in THREADED_TEST()
9940 v8_str("accessible_prop"), EchoGetter, EchoSetter, v8::Local<Value>(), in THREADED_TEST()
9944 v8::Local<Context> context0 = Context::New(isolate, NULL, obj_template); in THREADED_TEST()
9947 v8::Local<v8::Object> global0 = context0->Global(); in THREADED_TEST()
9951 v8::Local<Context> context1 = Context::New(isolate); in THREADED_TEST()
9954 v8::Local<v8::Object> global1 = context1->Global(); in THREADED_TEST()
9960 v8::Local<Value> value; in THREADED_TEST()
9985 v8::Local<v8::ObjectTemplate> obj_template = v8::ObjectTemplate::New(isolate); in TEST()
9989 ->Set(env.local(), v8_str("prohibited"), in TEST()
9990 obj_template->NewInstance(env.local()).ToLocalChecked()) in TEST()
10008 static void ConstTenGetter(Local<String> name, in ConstTenGetter()
10018 v8::Local<v8::FunctionTemplate> func_template = in THREADED_TEST()
10021 v8::Local<v8::ObjectTemplate> global_template = in THREADED_TEST()
10024 v8::Local<v8::ObjectTemplate> proto_template = in THREADED_TEST()
10029 v8::Local<Value>(), v8::ALL_CAN_READ); in THREADED_TEST()
10033 v8::Local<Value>(), v8::DEFAULT); in THREADED_TEST()
10035 v8::Local<Context> context0 = Context::New(isolate, NULL, global_template); in THREADED_TEST()
10038 Local<v8::Object> global = context0->Global(); in THREADED_TEST()
10044 v8::Local<Context> context1 = Context::New(isolate); in THREADED_TEST()
10047 v8::Local<v8::Object> global1 = context1->Global(); in THREADED_TEST()
10051 v8::Local<Value> value = in THREADED_TEST()
10067 static bool AccessCounter(Local<v8::Context> accessing_context, in AccessCounter()
10068 Local<v8::Object> accessed_object) { in AccessCounter()
10082 v8::Local<Context> context0 = Context::New(isolate); in TEST()
10087 v8::Local<v8::ObjectTemplate> object_template = in TEST()
10090 Local<v8::Object> object = in TEST()
10096 v8::Local<Context> context1 = Context::New(isolate); in TEST()
10100 v8::Local<v8::Object> global1 = context1->Global(); in TEST()
10103 v8::Local<Value> value; in TEST()
10206 Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10207 Local<ObjectTemplate> instance = t->InstanceTemplate(); in THREADED_TEST()
10213 Local<Value> o = t->GetFunction(context.local()) in THREADED_TEST()
10215 ->NewInstance(context.local()) in THREADED_TEST()
10218 CHECK(context->Global()->Set(context.local(), v8_str("i"), o).FromJust()); in THREADED_TEST()
10219 Local<Value> value = CompileRun("i.x"); in THREADED_TEST()
10220 CHECK_EQ(42, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
10223 CHECK_EQ(12, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
10228 Local<Name> key, const v8::PropertyCallbackInfo<v8::Value>&) { in GlobalObjectInstancePropertiesGet()
10237 Local<Value> global_object; in THREADED_TEST()
10239 Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10242 Local<ObjectTemplate> instance_template = t->InstanceTemplate(); in THREADED_TEST()
10270 Local<Value> value = CompileRun("x"); in THREADED_TEST()
10271 CHECK_EQ(42, value->Int32Value(env.local()).FromJust()); in THREADED_TEST()
10273 CHECK_EQ(12, value->Int32Value(env.local()).FromJust()); in THREADED_TEST()
10275 CHECK_EQ(1, value->Int32Value(env.local()).FromJust()); in THREADED_TEST()
10281 Local<Value> value = CompileRun("x"); in THREADED_TEST()
10282 CHECK_EQ(42, value->Int32Value(env.local()).FromJust()); in THREADED_TEST()
10284 CHECK_EQ(12, value->Int32Value(env.local()).FromJust()); in THREADED_TEST()
10286 CHECK_EQ(1, value->Int32Value(env.local()).FromJust()); in THREADED_TEST()
10295 Local<Value> global_object; in THREADED_TEST()
10297 Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10298 Local<ObjectTemplate> instance_template = t->InstanceTemplate(); in THREADED_TEST()
10314 Local<Value> foo; in THREADED_TEST()
10326 CHECK(env->Global()->Set(env.local(), v8_str("foo"), foo).FromJust()); in THREADED_TEST()
10344 static void ShadowYSetter(Local<String>, in ShadowYSetter()
10345 Local<Value>, in ShadowYSetter()
10352 static void ShadowYGetter(Local<String> name, in ShadowYGetter()
10365 static void ShadowNamedGet(Local<Name> key, in ShadowNamedGet()
10374 Local<ObjectTemplate> global_template = v8::ObjectTemplate::New(isolate); in THREADED_TEST()
10377 Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10382 Local<ObjectTemplate> proto = t->PrototypeTemplate(); in THREADED_TEST()
10383 Local<ObjectTemplate> instance = t->InstanceTemplate(); in THREADED_TEST()
10388 Local<Value>())); in THREADED_TEST()
10393 Local<Value> o = t->GetFunction(context.local()) in THREADED_TEST()
10395 ->NewInstance(context.local()) in THREADED_TEST()
10398 ->Set(context.local(), v8_str("__proto__"), o) in THREADED_TEST()
10401 Local<Value> value = in THREADED_TEST()
10404 CHECK(!value->BooleanValue(context.local()).FromJust()); in THREADED_TEST()
10407 CHECK_EQ(12, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
10410 CHECK_EQ(42, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
10416 CHECK_EQ(42, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
10425 Local<v8::FunctionTemplate> t0 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10427 Local<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10430 Local<v8::FunctionTemplate> t2 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10433 Local<v8::FunctionTemplate> t3 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10436 Local<v8::Object> o0 = t0->GetFunction(context.local()) in THREADED_TEST()
10438 ->NewInstance(context.local()) in THREADED_TEST()
10440 Local<v8::Object> o1 = t1->GetFunction(context.local()) in THREADED_TEST()
10442 ->NewInstance(context.local()) in THREADED_TEST()
10444 Local<v8::Object> o2 = t2->GetFunction(context.local()) in THREADED_TEST()
10446 ->NewInstance(context.local()) in THREADED_TEST()
10448 Local<v8::Object> o3 = t3->GetFunction(context.local()) in THREADED_TEST()
10450 ->NewInstance(context.local()) in THREADED_TEST()
10454 CHECK_EQ(0, o0->Get(context.local(), v8_str("x")) in THREADED_TEST()
10456 ->Int32Value(context.local()) in THREADED_TEST()
10458 CHECK(o0->Set(context.local(), v8_str("__proto__"), o1).FromJust()); in THREADED_TEST()
10459 CHECK_EQ(0, o0->Get(context.local(), v8_str("x")) in THREADED_TEST()
10461 ->Int32Value(context.local()) in THREADED_TEST()
10463 CHECK_EQ(1, o0->Get(context.local(), v8_str("y")) in THREADED_TEST()
10465 ->Int32Value(context.local()) in THREADED_TEST()
10467 CHECK(o0->Set(context.local(), v8_str("__proto__"), o2).FromJust()); in THREADED_TEST()
10468 CHECK_EQ(0, o0->Get(context.local(), v8_str("x")) in THREADED_TEST()
10470 ->Int32Value(context.local()) in THREADED_TEST()
10472 CHECK_EQ(1, o0->Get(context.local(), v8_str("y")) in THREADED_TEST()
10474 ->Int32Value(context.local()) in THREADED_TEST()
10476 CHECK_EQ(2, o0->Get(context.local(), v8_str("z")) in THREADED_TEST()
10478 ->Int32Value(context.local()) in THREADED_TEST()
10480 CHECK(o0->Set(context.local(), v8_str("__proto__"), o3).FromJust()); in THREADED_TEST()
10481 CHECK_EQ(0, o0->Get(context.local(), v8_str("x")) in THREADED_TEST()
10483 ->Int32Value(context.local()) in THREADED_TEST()
10485 CHECK_EQ(1, o0->Get(context.local(), v8_str("y")) in THREADED_TEST()
10487 ->Int32Value(context.local()) in THREADED_TEST()
10489 CHECK_EQ(2, o0->Get(context.local(), v8_str("z")) in THREADED_TEST()
10491 ->Int32Value(context.local()) in THREADED_TEST()
10493 CHECK_EQ(3, o0->Get(context.local(), v8_str("u")) in THREADED_TEST()
10495 ->Int32Value(context.local()) in THREADED_TEST()
10501 Local<Value> proto = in THREADED_TEST()
10502 o0->Get(context.local(), v8_str("__proto__")).ToLocalChecked(); in THREADED_TEST()
10505 ->Get(context.local(), v8_str("z")) in THREADED_TEST()
10516 Local<v8::FunctionTemplate> ot = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10517 Local<v8::FunctionTemplate> ht = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10519 Local<v8::FunctionTemplate> pt = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10522 Local<v8::Object> o = ot->GetFunction(context.local()) in THREADED_TEST()
10524 ->NewInstance(context.local()) in THREADED_TEST()
10526 Local<v8::Object> h = ht->GetFunction(context.local()) in THREADED_TEST()
10528 ->NewInstance(context.local()) in THREADED_TEST()
10530 Local<v8::Object> p = pt->GetFunction(context.local()) in THREADED_TEST()
10532 ->NewInstance(context.local()) in THREADED_TEST()
10534 CHECK(o->Set(context.local(), v8_str("__proto__"), h).FromJust()); in THREADED_TEST()
10535 CHECK(h->Set(context.local(), v8_str("__proto__"), p).FromJust()); in THREADED_TEST()
10538 CHECK(o->Set(context.local(), v8_str("x"), v8_num(7)).FromJust()); in THREADED_TEST()
10539 CHECK_EQ(7, o->Get(context.local(), v8_str("x")) in THREADED_TEST()
10541 ->Int32Value(context.local()) in THREADED_TEST()
10543 CHECK_EQ(7, h->Get(context.local(), v8_str("x")) in THREADED_TEST()
10545 ->Int32Value(context.local()) in THREADED_TEST()
10547 CHECK(p->Get(context.local(), v8_str("x")).ToLocalChecked()->IsUndefined()); in THREADED_TEST()
10550 CHECK(o->Set(context.local(), v8_str("y"), v8_num(6)).FromJust()); in THREADED_TEST()
10551 CHECK_EQ(6, o->Get(context.local(), v8_str("y")) in THREADED_TEST()
10553 ->Int32Value(context.local()) in THREADED_TEST()
10555 CHECK(h->Get(context.local(), v8_str("y")).ToLocalChecked()->IsUndefined()); in THREADED_TEST()
10556 CHECK(p->Get(context.local(), v8_str("y")).ToLocalChecked()->IsUndefined()); in THREADED_TEST()
10560 CHECK(p->Set(context.local(), v8_str("z"), v8_num(8)).FromJust()); in THREADED_TEST()
10561 CHECK_EQ(8, o->Get(context.local(), v8_str("z")) in THREADED_TEST()
10563 ->Int32Value(context.local()) in THREADED_TEST()
10565 CHECK_EQ(8, h->Get(context.local(), v8_str("z")) in THREADED_TEST()
10567 ->Int32Value(context.local()) in THREADED_TEST()
10569 CHECK_EQ(8, p->Get(context.local(), v8_str("z")) in THREADED_TEST()
10571 ->Int32Value(context.local()) in THREADED_TEST()
10573 CHECK(o->Set(context.local(), v8_str("z"), v8_num(9)).FromJust()); in THREADED_TEST()
10574 CHECK_EQ(9, o->Get(context.local(), v8_str("z")) in THREADED_TEST()
10576 ->Int32Value(context.local()) in THREADED_TEST()
10578 CHECK_EQ(8, h->Get(context.local(), v8_str("z")) in THREADED_TEST()
10580 ->Int32Value(context.local()) in THREADED_TEST()
10582 CHECK_EQ(8, p->Get(context.local(), v8_str("z")) in THREADED_TEST()
10584 ->Int32Value(context.local()) in THREADED_TEST()
10594 Local<FunctionTemplate> t = FunctionTemplate::New(context->GetIsolate()); in THREADED_TEST()
10597 Local<Object> p = t->GetFunction(context.local()) in THREADED_TEST()
10599 ->NewInstance(context.local()) in THREADED_TEST()
10601 Local<Object> o = Object::New(context->GetIsolate()); in THREADED_TEST()
10602 CHECK(o->SetPrototype(context.local(), p).FromJust()); in THREADED_TEST()
10606 CHECK(o->Set(context.local(), v8_str("foo"), v8_num(42)).FromJust()); in THREADED_TEST()
10616 Local<v8::FunctionTemplate> t0 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10618 Local<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10621 Local<v8::FunctionTemplate> t2 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10624 Local<v8::FunctionTemplate> t3 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10627 Local<v8::Object> o0 = t0->GetFunction(context.local()) in THREADED_TEST()
10629 ->NewInstance(context.local()) in THREADED_TEST()
10631 Local<v8::Object> o1 = t1->GetFunction(context.local()) in THREADED_TEST()
10633 ->NewInstance(context.local()) in THREADED_TEST()
10635 Local<v8::Object> o2 = t2->GetFunction(context.local()) in THREADED_TEST()
10637 ->NewInstance(context.local()) in THREADED_TEST()
10639 Local<v8::Object> o3 = t3->GetFunction(context.local()) in THREADED_TEST()
10641 ->NewInstance(context.local()) in THREADED_TEST()
10645 CHECK_EQ(0, o0->Get(context.local(), v8_str("x")) in THREADED_TEST()
10647 ->Int32Value(context.local()) in THREADED_TEST()
10649 CHECK(o0->SetPrototype(context.local(), o1).FromJust()); in THREADED_TEST()
10650 CHECK_EQ(0, o0->Get(context.local(), v8_str("x")) in THREADED_TEST()
10652 ->Int32Value(context.local()) in THREADED_TEST()
10654 CHECK_EQ(1, o0->Get(context.local(), v8_str("y")) in THREADED_TEST()
10656 ->Int32Value(context.local()) in THREADED_TEST()
10658 CHECK(o1->SetPrototype(context.local(), o2).FromJust()); in THREADED_TEST()
10659 CHECK_EQ(0, o0->Get(context.local(), v8_str("x")) in THREADED_TEST()
10661 ->Int32Value(context.local()) in THREADED_TEST()
10663 CHECK_EQ(1, o0->Get(context.local(), v8_str("y")) in THREADED_TEST()
10665 ->Int32Value(context.local()) in THREADED_TEST()
10667 CHECK_EQ(2, o0->Get(context.local(), v8_str("z")) in THREADED_TEST()
10669 ->Int32Value(context.local()) in THREADED_TEST()
10671 CHECK(o2->SetPrototype(context.local(), o3).FromJust()); in THREADED_TEST()
10672 CHECK_EQ(0, o0->Get(context.local(), v8_str("x")) in THREADED_TEST()
10674 ->Int32Value(context.local()) in THREADED_TEST()
10676 CHECK_EQ(1, o0->Get(context.local(), v8_str("y")) in THREADED_TEST()
10678 ->Int32Value(context.local()) in THREADED_TEST()
10680 CHECK_EQ(2, o0->Get(context.local(), v8_str("z")) in THREADED_TEST()
10682 ->Int32Value(context.local()) in THREADED_TEST()
10684 CHECK_EQ(3, o0->Get(context.local(), v8_str("u")) in THREADED_TEST()
10686 ->Int32Value(context.local()) in THREADED_TEST()
10692 Local<Value> proto = in THREADED_TEST()
10693 o0->Get(context.local(), v8_str("__proto__")).ToLocalChecked(); in THREADED_TEST()
10695 CHECK(proto.As<v8::Object>()->Equals(context.local(), o3).FromJust()); in THREADED_TEST()
10698 Local<Value> proto0 = o0->GetPrototype(); in THREADED_TEST()
10700 CHECK(proto0.As<v8::Object>()->Equals(context.local(), o1).FromJust()); in THREADED_TEST()
10702 Local<Value> proto1 = o1->GetPrototype(); in THREADED_TEST()
10704 CHECK(proto1.As<v8::Object>()->Equals(context.local(), o2).FromJust()); in THREADED_TEST()
10706 Local<Value> proto2 = o2->GetPrototype(); in THREADED_TEST()
10708 CHECK(proto2.As<v8::Object>()->Equals(context.local(), o3).FromJust()); in THREADED_TEST()
10721 Local<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10724 Local<v8::FunctionTemplate> t2 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10729 Local<v8::FunctionTemplate> t3 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10732 Local<v8::FunctionTemplate> t4 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10742 Local<v8::Object> o1 = t1->GetFunction(context.local()) in THREADED_TEST()
10744 ->NewInstance(context.local()) in THREADED_TEST()
10746 Local<v8::Object> o2 = t2->GetFunction(context.local()) in THREADED_TEST()
10748 ->NewInstance(context.local()) in THREADED_TEST()
10750 Local<v8::Object> o3 = t3->GetFunction(context.local()) in THREADED_TEST()
10752 ->NewInstance(context.local()) in THREADED_TEST()
10754 Local<v8::Object> o4 = t4->GetFunction(context.local()) in THREADED_TEST()
10756 ->NewInstance(context.local()) in THREADED_TEST()
10760 CHECK(o4->SetPrototype(context.local(), o3).FromJust()); in THREADED_TEST()
10761 CHECK(o3->SetPrototype(context.local(), o2).FromJust()); in THREADED_TEST()
10762 CHECK(o2->SetPrototype(context.local(), o1).FromJust()); in THREADED_TEST()
10766 CHECK(context->Global()->Set(context.local(), v8_str("obj"), o4).FromJust()); in THREADED_TEST()
10787 Local<v8::FunctionTemplate> t1 = in THREADED_TEST()
10791 Local<v8::ObjectTemplate> i1 = t1->InstanceTemplate(); in THREADED_TEST()
10801 Local<v8::Object> o1 = t1->GetFunction(context.local()) in THREADED_TEST()
10803 ->NewInstance(context.local()) in THREADED_TEST()
10805 Local<v8::FunctionTemplate> t2 = in THREADED_TEST()
10813 Local<v8::Object> o2 = t2->GetFunction(context.local()) in THREADED_TEST()
10815 ->NewInstance(context.local()) in THREADED_TEST()
10817 CHECK(o2->SetPrototype(context.local(), o1).FromJust()); in THREADED_TEST()
10819 v8::Local<v8::Symbol> sym = in THREADED_TEST()
10821 CHECK(o1->Set(context.local(), sym, v8_num(3)).FromJust()); in THREADED_TEST()
10822 o1->SetPrivate(context.local(), in THREADED_TEST()
10829 CHECK(context->Global()->Set(context.local(), v8_str("obj"), o2).FromJust()); in THREADED_TEST()
10830 CHECK(context->Global()->Set(context.local(), v8_str("sym"), sym).FromJust()); in THREADED_TEST()
10850 Local<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10854 ->Set(context.local(), v8_str("func1"), in THREADED_TEST()
10855 t1->GetFunction(context.local()).ToLocalChecked()) in THREADED_TEST()
10864 ->BooleanValue(context.local()) in THREADED_TEST()
10868 CompileRun("func1.prototype.x")->Int32Value(context.local()).FromJust()); in THREADED_TEST()
10870 ->Int32Value(context.local()) in THREADED_TEST()
10873 Local<v8::FunctionTemplate> t2 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10876 ->Set(context.local(), v8_str("func2"), in THREADED_TEST()
10877 t2->GetFunction(context.local()).ToLocalChecked()) in THREADED_TEST()
10886 ->BooleanValue(context.local()) in THREADED_TEST()
10890 CompileRun("func2.prototype.x")->Int32Value(context.local()).FromJust()); in THREADED_TEST()
10899 Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10901 Local<v8::Object> o0 = t->GetFunction(context.local()) in THREADED_TEST()
10903 ->NewInstance(context.local()) in THREADED_TEST()
10905 Local<v8::Object> o1 = t->GetFunction(context.local()) in THREADED_TEST()
10907 ->NewInstance(context.local()) in THREADED_TEST()
10910 CHECK(o0->SetPrototype(context.local(), o1).FromJust()); in THREADED_TEST()
10914 CHECK(o1->SetPrototype(context.local(), o0).IsNothing()); in THREADED_TEST()
10919 ->Int32Value(context.local()) in THREADED_TEST()
10929 Local<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10931 Local<v8::Function> fun = t1->GetFunction(context.local()).ToLocalChecked(); in THREADED_TEST()
10932 CHECK(context->Global()->Set(context.local(), v8_str("fun"), fun).FromJust()); in THREADED_TEST()
10934 ->BooleanValue(context.local()) in THREADED_TEST()
10942 CHECK(fun->NewInstance(context.local()).IsEmpty()); in THREADED_TEST()
10957 Local<v8::Object> x = Local<v8::Object>::Cast( in THREADED_TEST()
10958 context->Global()->Get(context.local(), v8_str("x")).ToLocalChecked()); in THREADED_TEST()
10960 CHECK(x->Set(context.local(), v8_str("set"), v8::Integer::New(isolate, 8)) in THREADED_TEST()
10962 CHECK(x->Get(context.local(), v8_str("get")).IsEmpty()); in THREADED_TEST()
10963 CHECK(x->Set(context.local(), v8_str("set"), v8::Integer::New(isolate, 8)) in THREADED_TEST()
10965 CHECK(x->Get(context.local(), v8_str("get")).IsEmpty()); in THREADED_TEST()
10966 CHECK(x->Set(context.local(), v8_str("set"), v8::Integer::New(isolate, 8)) in THREADED_TEST()
10968 CHECK(x->Get(context.local(), v8_str("get")).IsEmpty()); in THREADED_TEST()
10969 CHECK(x->Set(context.local(), v8_str("set"), v8::Integer::New(isolate, 8)) in THREADED_TEST()
10971 CHECK(x->Get(context.local(), v8_str("get")).IsEmpty()); in THREADED_TEST()
10979 Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
10981 Local<Function> cons = templ->GetFunction(context.local()).ToLocalChecked(); in THREADED_TEST()
10983 context->Global()->Set(context.local(), v8_str("Fun"), cons).FromJust()); in THREADED_TEST()
10984 Local<v8::Object> inst = cons->NewInstance(context.local()).ToLocalChecked(); in THREADED_TEST()
10987 Local<Value> value = CompileRun("(new Fun()).constructor === Fun"); in THREADED_TEST()
10988 CHECK(value->BooleanValue(context.local()).FromJust()); in THREADED_TEST()
10995 Local<Object> This; in ConstructorCallback()
10997 v8::Local<v8::Context> context = args.GetIsolate()->GetCurrentContext(); in ConstructorCallback()
10999 Local<Object> Holder = args.Holder(); in ConstructorCallback()
11001 Local<Value> proto = Holder->GetPrototype(); in ConstructorCallback()
11027 Local<ObjectTemplate> instance_template = ObjectTemplate::New(isolate); in THREADED_TEST()
11029 Local<Object> instance = in THREADED_TEST()
11030 instance_template->NewInstance(context.local()).ToLocalChecked(); in THREADED_TEST()
11032 ->Set(context.local(), v8_str("obj"), instance) in THREADED_TEST()
11035 Local<Value> value; in THREADED_TEST()
11042 CHECK_EQ(28, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
11044 Local<Value> args1[] = {v8_num(28)}; in THREADED_TEST()
11045 Local<Value> value_obj1 = in THREADED_TEST()
11046 instance->CallAsConstructor(context.local(), 1, args1).ToLocalChecked(); in THREADED_TEST()
11048 Local<Object> object1 = Local<Object>::Cast(value_obj1); in THREADED_TEST()
11049 value = object1->Get(context.local(), v8_str("a")).ToLocalChecked(); in THREADED_TEST()
11052 CHECK_EQ(28, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
11060 value->ToString(context.local()).ToLocalChecked()); in THREADED_TEST()
11063 Local<Value> args2[] = {v8_str("tipli")}; in THREADED_TEST()
11064 Local<Value> value_obj2 = in THREADED_TEST()
11065 instance->CallAsConstructor(context.local(), 1, args2).ToLocalChecked(); in THREADED_TEST()
11067 Local<Object> object2 = Local<Object>::Cast(value_obj2); in THREADED_TEST()
11068 value = object2->Get(context.local(), v8_str("a")).ToLocalChecked(); in THREADED_TEST()
11072 value->ToString(context.local()).ToLocalChecked()); in THREADED_TEST()
11079 CHECK_EQ(true, value->BooleanValue(context.local()).FromJust()); in THREADED_TEST()
11081 Local<Value> args3[] = {v8::True(isolate)}; in THREADED_TEST()
11082 Local<Value> value_obj3 = in THREADED_TEST()
11083 instance->CallAsConstructor(context.local(), 1, args3).ToLocalChecked(); in THREADED_TEST()
11085 Local<Object> object3 = Local<Object>::Cast(value_obj3); in THREADED_TEST()
11086 value = object3->Get(context.local(), v8_str("a")).ToLocalChecked(); in THREADED_TEST()
11089 CHECK_EQ(true, value->BooleanValue(context.local()).FromJust()); in THREADED_TEST()
11092 Local<Value> args4[] = {v8::Undefined(isolate)}; in THREADED_TEST()
11093 Local<Value> value_obj4 = in THREADED_TEST()
11094 instance->CallAsConstructor(context.local(), 1, args4).ToLocalChecked(); in THREADED_TEST()
11096 Local<Object> object4 = Local<Object>::Cast(value_obj4); in THREADED_TEST()
11097 value = object4->Get(context.local(), v8_str("a")).ToLocalChecked(); in THREADED_TEST()
11102 Local<Value> args5[] = {v8::Null(isolate)}; in THREADED_TEST()
11103 Local<Value> value_obj5 = in THREADED_TEST()
11104 instance->CallAsConstructor(context.local(), 1, args5).ToLocalChecked(); in THREADED_TEST()
11106 Local<Object> object5 = Local<Object>::Cast(value_obj5); in THREADED_TEST()
11107 value = object5->Get(context.local(), v8_str("a")).ToLocalChecked(); in THREADED_TEST()
11114 Local<ObjectTemplate> instance_template = ObjectTemplate::New(isolate); in THREADED_TEST()
11115 Local<Object> instance = in THREADED_TEST()
11116 instance_template->NewInstance(context.local()).ToLocalChecked(); in THREADED_TEST()
11118 ->Set(context.local(), v8_str("obj2"), instance) in THREADED_TEST()
11121 Local<Value> value; in THREADED_TEST()
11131 Local<Value> args[] = {v8_num(29)}; in THREADED_TEST()
11132 CHECK(instance->CallAsConstructor(context.local(), 1, args).IsEmpty()); in THREADED_TEST()
11142 Local<ObjectTemplate> instance_template = ObjectTemplate::New(isolate); in THREADED_TEST()
11144 Local<Object> instance = in THREADED_TEST()
11145 instance_template->NewInstance(context.local()).ToLocalChecked(); in THREADED_TEST()
11147 ->Set(context.local(), v8_str("obj3"), instance) in THREADED_TEST()
11150 Local<Value> value; in THREADED_TEST()
11159 Local<Value> args[] = {v8_num(23)}; in THREADED_TEST()
11160 CHECK(instance->CallAsConstructor(context.local(), 1, args).IsEmpty()); in THREADED_TEST()
11169 Local<FunctionTemplate> function_template = in THREADED_TEST()
11171 Local<Function> function = in THREADED_TEST()
11172 function_template->GetFunction(context.local()).ToLocalChecked(); in THREADED_TEST()
11173 Local<Object> instance1 = function; in THREADED_TEST()
11175 ->Set(context.local(), v8_str("obj4"), instance1) in THREADED_TEST()
11178 Local<Value> value; in THREADED_TEST()
11188 Local<Value> args1[] = {v8_num(28)}; in THREADED_TEST()
11189 value = instance1->CallAsConstructor(context.local(), 1, args1) in THREADED_TEST()
11194 Local<ObjectTemplate> instance_template = ObjectTemplate::New(isolate); in THREADED_TEST()
11196 Local<Object> instance2 = in THREADED_TEST()
11197 instance_template->NewInstance(context.local()).ToLocalChecked(); in THREADED_TEST()
11199 ->Set(context.local(), v8_str("obj5"), instance2) in THREADED_TEST()
11210 Local<Value> args2[] = {v8_num(28)}; in THREADED_TEST()
11211 value = instance2->CallAsConstructor(context.local(), 1, args2) in THREADED_TEST()
11223 Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
11225 Local<Function> cons = templ->GetFunction(context.local()).ToLocalChecked(); in THREADED_TEST()
11227 context->Global()->Set(context.local(), v8_str("Fun"), cons).FromJust()); in THREADED_TEST()
11228 Local<Value> value = CompileRun( in THREADED_TEST()
11242 CHECK_EQ(0, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
11251 Local<Script> script = v8_compile( in THREADED_TEST()
11262 script->Run(current.local()).ToLocalChecked(); in THREADED_TEST()
11264 ->Get(current.local(), v8_str("result1")) in THREADED_TEST()
11266 ->Int32Value(current.local()) in THREADED_TEST()
11269 ->Get(current.local(), v8_str("result2")) in THREADED_TEST()
11271 ->Int32Value(current.local()) in THREADED_TEST()
11274 ->Get(current.local(), v8_str("result3")) in THREADED_TEST()
11276 ->Int32Value(current.local()) in THREADED_TEST()
11286 script->Run(current.local()).ToLocalChecked(); in THREADED_TEST()
11289 ->Get(current.local(), v8_str("result4")) in THREADED_TEST()
11291 ->Int32Value(current.local()) in THREADED_TEST()
11303 Local<String> token = v8_str("<security token>"); in THREADED_TEST()
11309 ->Set(current.local(), v8_str("other"), other->Global()) in THREADED_TEST()
11313 Local<Script> script = v8_compile("other.eval('var foo = 1234')"); in THREADED_TEST()
11314 script->Run(current.local()).ToLocalChecked(); in THREADED_TEST()
11315 Local<Value> foo = in THREADED_TEST()
11316 other->Global()->Get(current.local(), v8_str("foo")).ToLocalChecked(); in THREADED_TEST()
11317 CHECK_EQ(1234, foo->Int32Value(other.local()).FromJust()); in THREADED_TEST()
11318 CHECK(!current->Global()->Has(current.local(), v8_str("foo")).FromJust()); in THREADED_TEST()
11323 script->Run(current.local()).ToLocalChecked(); in THREADED_TEST()
11325 ->Get(current.local(), v8_str("na")) in THREADED_TEST()
11327 ->Int32Value(other.local()) in THREADED_TEST()
11329 CHECK(!current->Global()->Has(current.local(), v8_str("na")).FromJust()); in THREADED_TEST()
11335 CHECK(script->Run(current.local()).IsEmpty()); in THREADED_TEST()
11339 // Check that local variables in current context are not visible in other in THREADED_TEST()
11346 CHECK(script->Run(current.local()).IsEmpty()); in THREADED_TEST()
11353 ->Set(other.local(), v8_str("bis"), v8_num(1234)) in THREADED_TEST()
11356 CHECK_EQ(1234, script->Run(current.local()) in THREADED_TEST()
11358 ->Int32Value(current.local()) in THREADED_TEST()
11365 ->Set(current.local(), v8_str("t"), other->Global()) in THREADED_TEST()
11368 Local<Value> result = script->Run(current.local()).ToLocalChecked(); in THREADED_TEST()
11375 CHECK(script->Run(current.local()).IsEmpty()); in THREADED_TEST()
11382 CHECK(script->Run(current.local()).IsEmpty()); in THREADED_TEST()
11393 v8::Local<Context> context0 = Context::New(isolate); in THREADED_TEST()
11394 v8::Local<Context> context1 = Context::New(isolate); in THREADED_TEST()
11398 v8::Local<v8::Value> fun = CompileRun( in THREADED_TEST()
11411 v8::Local<v8::Value> x_value = CompileRun("fun('x')"); in THREADED_TEST()
11426 Local<String> token = v8_str("<security token>"); in THREADED_TEST()
11432 ->Set(current.local(), v8_str("other"), other->Global()) in THREADED_TEST()
11436 Local<Script> script = v8_compile("other.eval('new Date(42)')"); in THREADED_TEST()
11437 Local<Value> value = script->Run(current.local()).ToLocalChecked(); in THREADED_TEST()
11438 CHECK_EQ(42.0, value->NumberValue(current.local()).FromJust()); in THREADED_TEST()
11472 Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
11473 Local<ObjectTemplate> instance_template = t->InstanceTemplate(); in THREADED_TEST()
11475 Local<v8::Object> instance = t->GetFunction(context.local()) in THREADED_TEST()
11477 ->NewInstance(context.local()) in THREADED_TEST()
11480 ->Set(context.local(), v8_str("obj"), instance) in THREADED_TEST()
11483 Local<Value> value; in THREADED_TEST()
11488 CHECK_EQ(42, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
11492 CHECK_EQ(49, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
11497 CHECK_EQ(45, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
11503 CHECK_EQ(87, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
11510 CHECK_EQ(99, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
11515 CHECK_EQ(17, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
11521 CHECK_EQ(-43, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
11525 v8::Local<Value> args[] = {v8_num(28)}; in THREADED_TEST()
11526 value = instance->CallAsFunction(context.local(), instance, 1, args) in THREADED_TEST()
11529 CHECK_EQ(28, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
11533 Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
11534 Local<ObjectTemplate> instance_template(t->InstanceTemplate()); in THREADED_TEST()
11536 Local<v8::Object> instance = t->GetFunction(context.local()) in THREADED_TEST()
11538 ->NewInstance(context.local()) in THREADED_TEST()
11541 ->Set(context.local(), v8_str("obj2"), instance) in THREADED_TEST()
11544 Local<Value> value; in THREADED_TEST()
11558 v8::Local<Value> args[] = {v8_num(28)}; in THREADED_TEST()
11560 instance->CallAsFunction(context.local(), instance, 1, args).IsEmpty()); in THREADED_TEST()
11569 Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
11570 Local<ObjectTemplate> instance_template = t->InstanceTemplate(); in THREADED_TEST()
11572 Local<v8::Object> instance = t->GetFunction(context.local()) in THREADED_TEST()
11574 ->NewInstance(context.local()) in THREADED_TEST()
11577 ->Set(context.local(), v8_str("obj3"), instance) in THREADED_TEST()
11580 Local<Value> value; in THREADED_TEST()
11590 v8::Local<Value> args[] = {v8_num(23)}; in THREADED_TEST()
11592 instance->CallAsFunction(context.local(), instance, 1, args).IsEmpty()); in THREADED_TEST()
11600 Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
11601 Local<ObjectTemplate> instance_template = t->InstanceTemplate(); in THREADED_TEST()
11603 Local<v8::Object> instance = t->GetFunction(context.local()) in THREADED_TEST()
11605 ->NewInstance(context.local()) in THREADED_TEST()
11608 Local<v8::Value> a1 = in THREADED_TEST()
11609 instance->CallAsFunction(context.local(), v8::Undefined(isolate), 0, in THREADED_TEST()
11613 Local<v8::Value> a2 = in THREADED_TEST()
11614 instance->CallAsFunction(context.local(), v8::Null(isolate), 0, NULL) in THREADED_TEST()
11617 Local<v8::Value> a3 = in THREADED_TEST()
11618 instance->CallAsFunction(context.local(), v8_num(42), 0, NULL) in THREADED_TEST()
11621 Local<v8::Value> a4 = in THREADED_TEST()
11622 instance->CallAsFunction(context.local(), v8_str("hello"), 0, NULL) in THREADED_TEST()
11625 Local<v8::Value> a5 = in THREADED_TEST()
11626 instance->CallAsFunction(context.local(), v8::True(isolate), 0, NULL) in THREADED_TEST()
11640 Local<Function> ReturnThisSloppy = Local<Function>::Cast( in THREADED_TEST()
11642 ->Get(context.local(), v8_str("ReturnThisSloppy")) in THREADED_TEST()
11644 Local<Function> ReturnThisStrict = Local<Function>::Cast( in THREADED_TEST()
11646 ->Get(context.local(), v8_str("ReturnThisStrict")) in THREADED_TEST()
11649 Local<v8::Value> a1 = in THREADED_TEST()
11650 ReturnThisSloppy->CallAsFunction(context.local(), in THREADED_TEST()
11654 Local<v8::Value> a2 = in THREADED_TEST()
11655 ReturnThisSloppy->CallAsFunction(context.local(), v8::Null(isolate), 0, in THREADED_TEST()
11659 Local<v8::Value> a3 = in THREADED_TEST()
11660 ReturnThisSloppy->CallAsFunction(context.local(), v8_num(42), 0, NULL) in THREADED_TEST()
11664 Local<v8::Value> a4 = in THREADED_TEST()
11665 ReturnThisSloppy->CallAsFunction(context.local(), v8_str("hello"), 0, in THREADED_TEST()
11670 Local<v8::Value> a5 = in THREADED_TEST()
11671 ReturnThisSloppy->CallAsFunction(context.local(), v8::True(isolate), 0, in THREADED_TEST()
11677 Local<v8::Value> a6 = in THREADED_TEST()
11678 ReturnThisStrict->CallAsFunction(context.local(), in THREADED_TEST()
11682 Local<v8::Value> a7 = in THREADED_TEST()
11683 ReturnThisStrict->CallAsFunction(context.local(), v8::Null(isolate), 0, in THREADED_TEST()
11687 Local<v8::Value> a8 = in THREADED_TEST()
11688 ReturnThisStrict->CallAsFunction(context.local(), v8_num(42), 0, NULL) in THREADED_TEST()
11691 Local<v8::Value> a9 = in THREADED_TEST()
11692 ReturnThisStrict->CallAsFunction(context.local(), v8_str("hello"), 0, in THREADED_TEST()
11696 Local<v8::Value> a10 = in THREADED_TEST()
11697 ReturnThisStrict->CallAsFunction(context.local(), v8::True(isolate), 0, in THREADED_TEST()
11712 Local<ObjectTemplate> instance_template = ObjectTemplate::New(isolate); in THREADED_TEST()
11714 Local<Object> instance = in THREADED_TEST()
11715 instance_template->NewInstance(context.local()).ToLocalChecked(); in THREADED_TEST()
11723 Local<ObjectTemplate> instance_template = ObjectTemplate::New(isolate); in THREADED_TEST()
11724 Local<Object> instance = in THREADED_TEST()
11725 instance_template->NewInstance(context.local()).ToLocalChecked(); in THREADED_TEST()
11733 Local<FunctionTemplate> function_template = in THREADED_TEST()
11735 Local<Function> function = in THREADED_TEST()
11736 function_template->GetFunction(context.local()).ToLocalChecked(); in THREADED_TEST()
11737 Local<Object> instance = function; in THREADED_TEST()
11745 Local<FunctionTemplate> function_template = FunctionTemplate::New(isolate); in THREADED_TEST()
11746 Local<Function> function = in THREADED_TEST()
11747 function_template->GetFunction(context.local()).ToLocalChecked(); in THREADED_TEST()
11748 Local<Object> instance = function; in THREADED_TEST()
11761 Local<v8::FunctionTemplate> desc = in THREADED_TEST()
11766 Local<v8::Object> obj = desc->GetFunction(env.local()) in THREADED_TEST()
11768 ->NewInstance(env.local()) in THREADED_TEST()
11771 env->Global()->Set(env.local(), v8_str("undetectable"), obj).FromJust()); in THREADED_TEST()
11809 Local<v8::Number> n(v8::Integer::New(isolate, 42)); in Recurse()
11826 Local<v8::Number> n(v8::Integer::New(CcTest::isolate(), 42)); in THREADED_TEST()
11834 Local<v8::Number> n(v8::Integer::New(CcTest::isolate(), 42)); in THREADED_TEST()
11847 Local<Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { in InterceptorCallICFastApi()
11922 v8::Local<v8::ObjectTemplate> nativeobject_templ = in THREADED_TEST()
11927 v8::Local<v8::Object> nativeobject_obj = in THREADED_TEST()
11928 nativeobject_templ->NewInstance(context.local()).ToLocalChecked(); in THREADED_TEST()
11930 ->Set(context.local(), v8_str("nativeobject"), nativeobject_obj) in THREADED_TEST()
11953 v8::Local<v8::ObjectTemplate> nativeobject_templ = in THREADED_TEST()
11958 v8::Local<v8::Object> nativeobject_obj = in THREADED_TEST()
11959 nativeobject_templ->NewInstance(context.local()).ToLocalChecked(); in THREADED_TEST()
11961 ->Set(context.local(), v8_str("nativeobject"), nativeobject_obj) in THREADED_TEST()
11964 v8::Local<Value> result = CompileRun( in THREADED_TEST()
11972 CHECK(v8_str("ggggg")->Equals(context.local(), result).FromJust()); in THREADED_TEST()
11979 static Local<Value> DoDirectGetter() { in DoDirectGetter()
11989 Local<String> name, in DirectGetterCallback()
12001 v8::Local<v8::ObjectTemplate> obj = v8::ObjectTemplate::New(isolate); in LoadICFastApi_DirectCall_GCMoveStub()
12004 ->Set(context.local(), v8_str("o1"), in LoadICFastApi_DirectCall_GCMoveStub()
12005 obj->NewInstance(context.local()).ToLocalChecked()) in LoadICFastApi_DirectCall_GCMoveStub()
12008 v8::Local<v8::Value> result = CompileRun( in LoadICFastApi_DirectCall_GCMoveStub()
12015 ->Equals(context.local(), result) in LoadICFastApi_DirectCall_GCMoveStub()
12027 Local<String> name, in ThrowingDirectGetterCallback()
12037 v8::Local<v8::ObjectTemplate> obj = v8::ObjectTemplate::New(isolate); in THREADED_TEST()
12040 ->Set(context.local(), v8_str("o1"), in THREADED_TEST()
12041 obj->NewInstance(context.local()).ToLocalChecked()) in THREADED_TEST()
12043 v8::Local<Value> result = CompileRun( in THREADED_TEST()
12049 CHECK(v8_str("ggggg")->Equals(context.local(), result).FromJust()); in THREADED_TEST()
12057 v8::Local<v8::FunctionTemplate> fun_templ = in THREADED_PROFILED_TEST()
12059 v8::Local<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New( in THREADED_PROFILED_TEST()
12061 v8::Local<v8::Signature>()); in THREADED_PROFILED_TEST()
12062 v8::Local<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate(); in THREADED_PROFILED_TEST()
12064 v8::Local<v8::ObjectTemplate> templ = fun_templ->InstanceTemplate(); in THREADED_PROFILED_TEST()
12069 v8::Local<v8::Function> fun = in THREADED_PROFILED_TEST()
12070 fun_templ->GetFunction(context.local()).ToLocalChecked(); in THREADED_PROFILED_TEST()
12073 ->Set(context.local(), v8_str("o"), in THREADED_PROFILED_TEST()
12074 fun->NewInstance(context.local()).ToLocalChecked()) in THREADED_PROFILED_TEST()
12082 ->Get(context.local(), v8_str("result")) in THREADED_PROFILED_TEST()
12084 ->Int32Value(context.local()) in THREADED_PROFILED_TEST()
12094 v8::Local<v8::FunctionTemplate> fun_templ = in THREADED_PROFILED_TEST()
12096 v8::Local<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New( in THREADED_PROFILED_TEST()
12099 v8::Local<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate(); in THREADED_PROFILED_TEST()
12102 v8::Local<v8::ObjectTemplate> templ = fun_templ->InstanceTemplate(); in THREADED_PROFILED_TEST()
12107 v8::Local<v8::Function> fun = in THREADED_PROFILED_TEST()
12108 fun_templ->GetFunction(context.local()).ToLocalChecked(); in THREADED_PROFILED_TEST()
12111 ->Set(context.local(), v8_str("o"), in THREADED_PROFILED_TEST()
12112 fun->NewInstance(context.local()).ToLocalChecked()) in THREADED_PROFILED_TEST()
12123 ->Get(context.local(), v8_str("result")) in THREADED_PROFILED_TEST()
12125 ->Int32Value(context.local()) in THREADED_PROFILED_TEST()
12135 v8::Local<v8::FunctionTemplate> fun_templ = in THREADED_PROFILED_TEST()
12137 v8::Local<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New( in THREADED_PROFILED_TEST()
12140 v8::Local<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate(); in THREADED_PROFILED_TEST()
12143 v8::Local<v8::ObjectTemplate> templ = fun_templ->InstanceTemplate(); in THREADED_PROFILED_TEST()
12148 v8::Local<v8::Function> fun = in THREADED_PROFILED_TEST()
12149 fun_templ->GetFunction(context.local()).ToLocalChecked(); in THREADED_PROFILED_TEST()
12152 ->Set(context.local(), v8_str("o"), in THREADED_PROFILED_TEST()
12153 fun->NewInstance(context.local()).ToLocalChecked()) in THREADED_PROFILED_TEST()
12169 ->Get(context.local(), v8_str("result")) in THREADED_PROFILED_TEST()
12171 ->Int32Value(context.local()) in THREADED_PROFILED_TEST()
12174 ->Get(context.local(), v8_str("saved_result")) in THREADED_PROFILED_TEST()
12176 ->Int32Value(context.local()) in THREADED_PROFILED_TEST()
12186 v8::Local<v8::FunctionTemplate> fun_templ = in THREADED_PROFILED_TEST()
12188 v8::Local<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New( in THREADED_PROFILED_TEST()
12191 v8::Local<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate(); in THREADED_PROFILED_TEST()
12194 v8::Local<v8::ObjectTemplate> templ = fun_templ->InstanceTemplate(); in THREADED_PROFILED_TEST()
12199 v8::Local<v8::Function> fun = in THREADED_PROFILED_TEST()
12200 fun_templ->GetFunction(context.local()).ToLocalChecked(); in THREADED_PROFILED_TEST()
12203 ->Set(context.local(), v8_str("o"), in THREADED_PROFILED_TEST()
12204 fun->NewInstance(context.local()).ToLocalChecked()) in THREADED_PROFILED_TEST()
12220 ->Get(context.local(), v8_str("result")) in THREADED_PROFILED_TEST()
12222 ->Int32Value(context.local()) in THREADED_PROFILED_TEST()
12225 ->Get(context.local(), v8_str("saved_result")) in THREADED_PROFILED_TEST()
12227 ->Int32Value(context.local()) in THREADED_PROFILED_TEST()
12237 v8::Local<v8::FunctionTemplate> fun_templ = in THREADED_PROFILED_TEST()
12239 v8::Local<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New( in THREADED_PROFILED_TEST()
12242 v8::Local<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate(); in THREADED_PROFILED_TEST()
12245 v8::Local<v8::ObjectTemplate> templ = fun_templ->InstanceTemplate(); in THREADED_PROFILED_TEST()
12250 v8::Local<v8::Function> fun = in THREADED_PROFILED_TEST()
12251 fun_templ->GetFunction(context.local()).ToLocalChecked(); in THREADED_PROFILED_TEST()
12254 ->Set(context.local(), v8_str("o"), in THREADED_PROFILED_TEST()
12255 fun->NewInstance(context.local()).ToLocalChecked()) in THREADED_PROFILED_TEST()
12276 context.local(), in THREADED_PROFILED_TEST()
12277 try_catch.Exception()->ToString(context.local()).ToLocalChecked()) in THREADED_PROFILED_TEST()
12280 ->Get(context.local(), v8_str("saved_result")) in THREADED_PROFILED_TEST()
12282 ->Int32Value(context.local()) in THREADED_PROFILED_TEST()
12292 v8::Local<v8::FunctionTemplate> fun_templ = in THREADED_PROFILED_TEST()
12294 v8::Local<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New( in THREADED_PROFILED_TEST()
12297 v8::Local<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate(); in THREADED_PROFILED_TEST()
12300 v8::Local<v8::ObjectTemplate> templ = fun_templ->InstanceTemplate(); in THREADED_PROFILED_TEST()
12305 v8::Local<v8::Function> fun = in THREADED_PROFILED_TEST()
12306 fun_templ->GetFunction(context.local()).ToLocalChecked(); in THREADED_PROFILED_TEST()
12309 ->Set(context.local(), v8_str("o"), in THREADED_PROFILED_TEST()
12310 fun->NewInstance(context.local()).ToLocalChecked()) in THREADED_PROFILED_TEST()
12330 context.local(), in THREADED_PROFILED_TEST()
12331 try_catch.Exception()->ToString(context.local()).ToLocalChecked()) in THREADED_PROFILED_TEST()
12334 ->Get(context.local(), v8_str("saved_result")) in THREADED_PROFILED_TEST()
12336 ->Int32Value(context.local()) in THREADED_PROFILED_TEST()
12345 v8::Local<v8::FunctionTemplate> fun_templ = in THREADED_PROFILED_TEST()
12347 v8::Local<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New( in THREADED_PROFILED_TEST()
12349 v8::Local<v8::Signature>()); in THREADED_PROFILED_TEST()
12350 v8::Local<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate(); in THREADED_PROFILED_TEST()
12352 v8::Local<v8::ObjectTemplate> templ(fun_templ->InstanceTemplate()); in THREADED_PROFILED_TEST()
12355 v8::Local<v8::Function> fun = in THREADED_PROFILED_TEST()
12356 fun_templ->GetFunction(context.local()).ToLocalChecked(); in THREADED_PROFILED_TEST()
12359 ->Set(context.local(), v8_str("o"), in THREADED_PROFILED_TEST()
12360 fun->NewInstance(context.local()).ToLocalChecked()) in THREADED_PROFILED_TEST()
12369 ->Get(context.local(), v8_str("result")) in THREADED_PROFILED_TEST()
12371 ->Int32Value(context.local()) in THREADED_PROFILED_TEST()
12379 v8::Local<v8::FunctionTemplate> fun_templ = in THREADED_PROFILED_TEST()
12381 v8::Local<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New( in THREADED_PROFILED_TEST()
12384 v8::Local<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate(); in THREADED_PROFILED_TEST()
12387 v8::Local<v8::ObjectTemplate> templ(fun_templ->InstanceTemplate()); in THREADED_PROFILED_TEST()
12390 v8::Local<v8::Function> fun = in THREADED_PROFILED_TEST()
12391 fun_templ->GetFunction(context.local()).ToLocalChecked(); in THREADED_PROFILED_TEST()
12394 ->Set(context.local(), v8_str("o"), in THREADED_PROFILED_TEST()
12395 fun->NewInstance(context.local()).ToLocalChecked()) in THREADED_PROFILED_TEST()
12407 ->Get(context.local(), v8_str("result")) in THREADED_PROFILED_TEST()
12409 ->Int32Value(context.local()) in THREADED_PROFILED_TEST()
12417 v8::Local<v8::FunctionTemplate> fun_templ = in THREADED_PROFILED_TEST()
12419 v8::Local<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New( in THREADED_PROFILED_TEST()
12422 v8::Local<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate(); in THREADED_PROFILED_TEST()
12425 v8::Local<v8::ObjectTemplate> templ(fun_templ->InstanceTemplate()); in THREADED_PROFILED_TEST()
12428 v8::Local<v8::Function> fun = in THREADED_PROFILED_TEST()
12429 fun_templ->GetFunction(context.local()).ToLocalChecked(); in THREADED_PROFILED_TEST()
12432 ->Set(context.local(), v8_str("o"), in THREADED_PROFILED_TEST()
12433 fun->NewInstance(context.local()).ToLocalChecked()) in THREADED_PROFILED_TEST()
12449 ->Get(context.local(), v8_str("result")) in THREADED_PROFILED_TEST()
12451 ->Int32Value(context.local()) in THREADED_PROFILED_TEST()
12454 ->Get(context.local(), v8_str("saved_result")) in THREADED_PROFILED_TEST()
12456 ->Int32Value(context.local()) in THREADED_PROFILED_TEST()
12464 v8::Local<v8::FunctionTemplate> fun_templ = in THREADED_PROFILED_TEST()
12466 v8::Local<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New( in THREADED_PROFILED_TEST()
12469 v8::Local<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate(); in THREADED_PROFILED_TEST()
12472 v8::Local<v8::ObjectTemplate> templ(fun_templ->InstanceTemplate()); in THREADED_PROFILED_TEST()
12475 v8::Local<v8::Function> fun = in THREADED_PROFILED_TEST()
12476 fun_templ->GetFunction(context.local()).ToLocalChecked(); in THREADED_PROFILED_TEST()
12479 ->Set(context.local(), v8_str("o"), in THREADED_PROFILED_TEST()
12480 fun->NewInstance(context.local()).ToLocalChecked()) in THREADED_PROFILED_TEST()
12501 context.local(), in THREADED_PROFILED_TEST()
12502 try_catch.Exception()->ToString(context.local()).ToLocalChecked()) in THREADED_PROFILED_TEST()
12505 ->Get(context.local(), v8_str("saved_result")) in THREADED_PROFILED_TEST()
12507 ->Int32Value(context.local()) in THREADED_PROFILED_TEST()
12515 v8::Local<v8::FunctionTemplate> fun_templ = in THREADED_PROFILED_TEST()
12517 v8::Local<v8::FunctionTemplate> method_templ = v8::FunctionTemplate::New( in THREADED_PROFILED_TEST()
12520 v8::Local<v8::ObjectTemplate> proto_templ = fun_templ->PrototypeTemplate(); in THREADED_PROFILED_TEST()
12523 v8::Local<v8::ObjectTemplate> templ(fun_templ->InstanceTemplate()); in THREADED_PROFILED_TEST()
12526 v8::Local<v8::Function> fun = in THREADED_PROFILED_TEST()
12527 fun_templ->GetFunction(context.local()).ToLocalChecked(); in THREADED_PROFILED_TEST()
12530 ->Set(context.local(), v8_str("o"), in THREADED_PROFILED_TEST()
12531 fun->NewInstance(context.local()).ToLocalChecked()) in THREADED_PROFILED_TEST()
12551 context.local(), in THREADED_PROFILED_TEST()
12552 try_catch.Exception()->ToString(context.local()).ToLocalChecked()) in THREADED_PROFILED_TEST()
12555 ->Get(context.local(), v8_str("saved_result")) in THREADED_PROFILED_TEST()
12557 ->Int32Value(context.local()) in THREADED_PROFILED_TEST()
12562 static void ThrowingGetter(Local<String> name, in ThrowingGetter()
12565 info.GetIsolate()->ThrowException(Local<Value>()); in ThrowingGetter()
12574 Local<FunctionTemplate> templ = FunctionTemplate::New(context->GetIsolate()); in THREADED_TEST()
12575 Local<ObjectTemplate> instance_templ = templ->InstanceTemplate(); in THREADED_TEST()
12578 Local<Object> instance = templ->GetFunction(context.local()) in THREADED_TEST()
12580 ->NewInstance(context.local()) in THREADED_TEST()
12583 Local<Object> another = Object::New(context->GetIsolate()); in THREADED_TEST()
12584 CHECK(another->SetPrototype(context.local(), instance).FromJust()); in THREADED_TEST()
12586 Local<Object> with_js_getter = CompileRun( in THREADED_TEST()
12595 instance->GetRealNamedProperty(context.local(), v8_str("f")); in THREADED_TEST()
12601 instance->GetRealNamedPropertyAttributes(context.local(), v8_str("f")); in THREADED_TEST()
12605 result = another->GetRealNamedProperty(context.local(), v8_str("f")); in THREADED_TEST()
12610 attr = another->GetRealNamedPropertyAttributes(context.local(), v8_str("f")); in THREADED_TEST()
12614 result = another->GetRealNamedPropertyInPrototypeChain(context.local(), in THREADED_TEST()
12621 context.local(), v8_str("f")); in THREADED_TEST()
12625 result = another->Get(context.local(), v8_str("f")); in THREADED_TEST()
12630 result = with_js_getter->GetRealNamedProperty(context.local(), v8_str("f")); in THREADED_TEST()
12635 attr = with_js_getter->GetRealNamedPropertyAttributes(context.local(), in THREADED_TEST()
12640 result = with_js_getter->Get(context.local(), v8_str("f")); in THREADED_TEST()
12663 static void WithTryCatch(Local<Message> message, Local<Value> data) { in WithTryCatch()
12668 static void ThrowFromJS(Local<Message> message, Local<Value> data) { in ThrowFromJS()
12673 static void ThrowViaApi(Local<Message> message, Local<Value> data) { in ThrowViaApi()
12678 static void WebKitLike(Local<Message> message, Local<Value> data) { in WebKitLike()
12679 Local<String> errorMessageString = message->Get(); in WebKitLike()
12691 Local<Function> func = in THREADED_TEST()
12693 ->GetFunction(context.local()) in THREADED_TEST()
12696 context->Global()->Set(context.local(), v8_str("func"), func).FromJust()); in THREADED_TEST()
12719 static void ParentGetter(Local<String> name, in ParentGetter()
12726 static void ChildGetter(Local<String> name, in ChildGetter()
12739 Local<v8::FunctionTemplate> parent_templ = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
12740 Local<ObjectTemplate> parent_instance_templ = in THREADED_TEST()
12745 Local<v8::FunctionTemplate> child_templ = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
12746 Local<ObjectTemplate> child_instance_templ = in THREADED_TEST()
12758 Local<ObjectTemplate> child_proto_templ = child_templ->PrototypeTemplate(); in THREADED_TEST()
12760 v8::Local<Value>(), v8::DEFAULT, v8::ReadOnly); in THREADED_TEST()
12766 v8::Local<Value>(), v8::DEFAULT, in THREADED_TEST()
12771 Local<v8::Object> instance = child_templ->GetFunction(context.local()) in THREADED_TEST()
12773 ->NewInstance(context.local()) in THREADED_TEST()
12778 ->Set(context.local(), v8_str("o"), instance) in THREADED_TEST()
12780 Local<Value> value = v8_compile("o.f")->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
12782 CHECK_EQ(42, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
12783 value = v8_compile("o.g")->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
12784 CHECK_EQ(42, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
12787 value = v8_compile("o.h = 3; o.h")->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
12788 CHECK_EQ(1, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
12791 value = v8_compile("o.i = 3; o.i")->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
12792 CHECK_EQ(42, value->Int32Value(context.local()).FromJust()); in THREADED_TEST()
12808 Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
12814 ->Set(context.local(), v8_str("f"), in THREADED_TEST()
12815 templ->GetFunction(context.local()).ToLocalChecked()) in THREADED_TEST()
12817 Local<Value> value = v8_compile("f()")->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
12818 CHECK(!value->BooleanValue(context.local()).FromJust()); in THREADED_TEST()
12819 value = v8_compile("new f()")->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
12820 CHECK(value->BooleanValue(context.local()).FromJust()); in THREADED_TEST()
12827 Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
12832 Local<String> customized_tostring = v8_str("customized toString"); in THREADED_TEST()
12839 ->Run(context.local()) in THREADED_TEST()
12843 Local<v8::Object> instance = templ->GetFunction(context.local()) in THREADED_TEST()
12845 ->NewInstance(context.local()) in THREADED_TEST()
12847 Local<String> value = instance->ToString(context.local()).ToLocalChecked(); in THREADED_TEST()
12849 value->Equals(context.local(), customized_tostring).FromJust()); in THREADED_TEST()
12852 value = instance->ObjectProtoToString(context.local()).ToLocalChecked(); in THREADED_TEST()
12854 value->Equals(context.local(), v8_str("[object MyClass]")).FromJust()); in THREADED_TEST()
12858 context->Global()->ObjectProtoToString(context.local()).ToLocalChecked(); in THREADED_TEST()
12860 value->Equals(context.local(), v8_str("[object global]")).FromJust()); in THREADED_TEST()
12863 Local<Value> object = in THREADED_TEST()
12864 v8_compile("new Object()")->Run(context.local()).ToLocalChecked(); in THREADED_TEST()
12866 ->ObjectProtoToString(context.local()) in THREADED_TEST()
12869 value->Equals(context.local(), v8_str("[object Object]")).FromJust()); in THREADED_TEST()
12879 Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate); in TEST()
12882 Local<String> customized_tostring = v8_str("customized toString"); in TEST()
12891 Local<v8::Object> instance = templ->GetFunction(context.local()) in TEST()
12893 ->NewInstance(context.local()) in TEST()
12895 Local<String> value = instance->ToString(context.local()).ToLocalChecked(); in TEST()
12897 value->Equals(context.local(), customized_tostring).FromJust()); in TEST()
12900 value = instance->ObjectProtoToString(context.local()).ToLocalChecked(); in TEST()
12902 value->Equals(context.local(), v8_str("[object MyClass]")).FromJust()); in TEST()
12906 context->Global()->ObjectProtoToString(context.local()).ToLocalChecked(); in TEST()
12908 value->Equals(context.local(), v8_str("[object global]")).FromJust()); in TEST()
12911 Local<Value> object = CompileRun("new Object()"); in TEST()
12913 ->ObjectProtoToString(context.local()) in TEST()
12916 value->Equals(context.local(), v8_str("[object Object]")).FromJust()); in TEST()
12919 Local<v8::Symbol> toStringTag = v8::Symbol::GetToStringTag(isolate); in TEST()
12925 ->Set(context.local(), toStringTag, v8_str(#tag)) \ in TEST()
12928 ->ObjectProtoToString(context.local()) \ in TEST()
12931 value->Equals(context.local(), v8_str("[object " #expected "]")) \ in TEST()
12949 Local<v8::RegExp> valueRegExp = in TEST()
12950 v8::RegExp::New(context.local(), v8_str("^$"), v8::RegExp::kNone) in TEST()
12952 Local<Value> valueNumber = v8_num(123); in TEST()
12953 Local<v8::Symbol> valueSymbol = v8_symbol("TestSymbol"); in TEST()
12954 Local<v8::Function> valueFunction = in TEST()
12956 Local<v8::Object> valueObject = v8::Object::New(v8::Isolate::GetCurrent()); in TEST()
12957 Local<v8::Primitive> valueNull = v8::Null(v8::Isolate::GetCurrent()); in TEST()
12958 Local<v8::Primitive> valueUndef = v8::Undefined(v8::Isolate::GetCurrent()); in TEST()
12964 ->Set(context.local(), toStringTag, tagValue) \ in TEST()
12967 ->ObjectProtoToString(context.local()) \ in TEST()
12970 value->Equals(context.local(), v8_str("[object " #expected "]")) \ in TEST()
12995 Local<Value> obj = v8::Object::New(isolate); in TEST()
12997 ->SetAccessor(context.local(), toStringTag, ThrowingSymbolAccessorGetter) in TEST()
13001 CHECK(obj.As<v8::Object>()->ObjectProtoToString(context.local()).IsEmpty()); in TEST()
13008 ->SetAccessor(context.local(), toStringTag, in TEST()
13014 ->ObjectProtoToString(context.local()) in TEST()
13017 value->Equals(context.local(), v8_str("[object Test]")).FromJust()); in TEST()
13026 ->ObjectProtoToString(context.local()) in TEST()
13029 value->Equals(context.local(), v8_str("[object Test]")).FromJust()); in TEST()
13040 CHECK(obj.As<v8::Object>()->ObjectProtoToString(context.local()).IsEmpty()); in TEST()
13052 ->ObjectProtoToString(context.local()) in TEST()
13055 value->Equals(context.local(), v8_str("[object Test]")).FromJust()); in TEST()
13075 ->Run(context.local()) in THREADED_TEST()
13078 Local<v8::Value> p = in THREADED_TEST()
13079 context->Global()->Get(context.local(), v8_str("p")).ToLocalChecked(); in THREADED_TEST()
13081 p->ToObject(context.local()) in THREADED_TEST()
13084 ->Equals(context.local(), v8_str("Parent")) in THREADED_TEST()
13087 Local<v8::Value> c = in THREADED_TEST()
13088 context->Global()->Get(context.local(), v8_str("c")).ToLocalChecked(); in THREADED_TEST()
13090 c->ToObject(context.local()) in THREADED_TEST()
13093 ->Equals(context.local(), v8_str("Child")) in THREADED_TEST()
13096 Local<v8::Value> x = in THREADED_TEST()
13097 context->Global()->Get(context.local(), v8_str("x")).ToLocalChecked(); in THREADED_TEST()
13099 x->ToObject(context.local()) in THREADED_TEST()
13102 ->Equals(context.local(), v8_str("outer.inner")) in THREADED_TEST()
13105 Local<v8::Value> child_prototype = in THREADED_TEST()
13106 context->Global()->Get(context.local(), v8_str("proto")).ToLocalChecked(); in THREADED_TEST()
13108 child_prototype->ToObject(context.local()) in THREADED_TEST()
13111 ->Equals(context.local(), v8_str("Parent")) in THREADED_TEST()
13126 ->Run(context.local()) in THREADED_TEST()
13129 Local<v8::Value> p = in THREADED_TEST()
13130 context->Global()->Get(context.local(), v8_str("p")).ToLocalChecked(); in THREADED_TEST()
13132 p->ToObject(context.local()) in THREADED_TEST()
13135 ->Equals(context.local(), v8_str("Parent")) in THREADED_TEST()
13138 Local<v8::Value> c = in THREADED_TEST()
13139 context->Global()->Get(context.local(), v8_str("c")).ToLocalChecked(); in THREADED_TEST()
13141 c->ToObject(context.local()) in THREADED_TEST()
13144 ->Equals(context.local(), v8_str("Child")) in THREADED_TEST()
13320 v8::Local<Value> exception; in ThrowInJS()
13323 v8::Local<Value> value = CompileRun(code); in ThrowInJS()
13329 exception = Local<Value>::New(isolate, try_catch.Exception()); in ThrowInJS()
13344 v8::Local<Value> value = CompileRun(code); in ThrowInJSNoCatch()
13359 Local<v8::FunctionTemplate> fun_templ = in TEST()
13361 Local<Function> fun = fun_templ->GetFunction(env.local()).ToLocalChecked(); in TEST()
13362 CHECK(env->Global()->Set(env.local(), v8_str("throw_in_js"), fun).FromJust()); in TEST()
13363 Local<Script> script = v8_compile("(function () {" in TEST()
13371 CHECK_EQ(91, script->Run(env.local()) in TEST()
13373 ->Int32Value(env.local()) in TEST()
13384 Local<v8::FunctionTemplate> fun_templ = in TEST()
13386 Local<Function> fun = fun_templ->GetFunction(env.local()).ToLocalChecked(); in TEST()
13387 CHECK(env->Global()->Set(env.local(), v8_str("throw_in_js"), fun).FromJust()); in TEST()
13388 Local<Script> script = v8_compile("(function () {" in TEST()
13396 CHECK_EQ(91, script->Run(env.local()) in TEST()
13398 ->Int32Value(env.local()) in TEST()
13423 Local<v8::FunctionTemplate> fun_templ = in THREADED_TEST()
13425 Local<Function> fun = fun_templ->GetFunction(env.local()).ToLocalChecked(); in THREADED_TEST()
13427 ->Set(env.local(), v8_str("unlock_for_a_moment"), fun) in THREADED_TEST()
13429 Local<Script> script = v8_compile("(function () {" in THREADED_TEST()
13433 CHECK_EQ(42, script->Run(env.local()) in THREADED_TEST()
13435 ->Int32Value(env.local()) in THREADED_TEST()
13442 Local<v8::FunctionTemplate> fun_templ = in THREADED_TEST()
13444 Local<Function> fun = fun_templ->GetFunction(env.local()).ToLocalChecked(); in THREADED_TEST()
13446 ->Set(env.local(), v8_str("unlock_for_a_moment"), fun) in THREADED_TEST()
13448 Local<Script> script = v8_compile("(function () {" in THREADED_TEST()
13452 CHECK_EQ(42, script->Run(env.local()) in THREADED_TEST()
13454 ->Int32Value(env.local()) in THREADED_TEST()
13506 v8_compile("Date")->Run(context.local()).ToLocalChecked(); in TEST()
13513 v8_compile("/aaa/")->Run(context.local()).ToLocalChecked(); in TEST()
13522 v8_compile("gc();")->Run(context.local()).ToLocalChecked(); in TEST()
13573 v8::Local<v8::Object> obj = v8::Object::New(isolate); in TEST()
13575 obj->Set(context.local(), v8_str("key"), v8::Integer::New(isolate, 231)) in TEST()
13725 static v8::Local<Value> NestedScope(v8::Local<Context> env) { in NestedScope()
13728 v8::Local<Value> three = v8_num(3); in NestedScope()
13729 v8::Local<Value> value = inner.Escape(three); in NestedScope()
13738 v8::Local<Context> env = Context::New(isolate); in THREADED_TEST()
13740 v8::Local<Value> value = NestedScope(env); in THREADED_TEST()
13741 v8::Local<String> str(value->ToString(env).ToLocalChecked()); in THREADED_TEST()
13983 v8::Local<Context> env = Context::New(isolate); in RunLoopInNewEnv()
13986 Local<ObjectTemplate> t = ObjectTemplate::New(isolate); in RunLoopInNewEnv()
14011 v8::Local<v8::Value> value = CompileRun("bar();"); in RunLoopInNewEnv()
14273 ->Get(env.local(), v8_str("bar")) in UNINITIALIZED_TEST()
14279 ->Get(env.local(), v8_str("foo")) in UNINITIALIZED_TEST()
14342 v8::Local<Context> env(Context::New(isolate)); in THREADED_TEST()
14380 v8::Local<v8::ObjectTemplate> local = v8::ObjectTemplate::New(isolate); in THREADED_TEST() local
14381 local->SetInternalFieldCount(1); in THREADED_TEST()
14382 templ.Reset(isolate, inner.Escape(local)); in THREADED_TEST()
14384 v8::Local<v8::Object> result = in THREADED_TEST()
14385 v8::Local<v8::ObjectTemplate>::New(isolate, templ) in THREADED_TEST()
14386 ->NewInstance(context.local()) in THREADED_TEST()
14398 v8::Local<v8::Value> result = CompileRun( in TEST()
14408 static void CheckTryCatchSourceInfo(v8::Local<v8::Script> script, in CheckTryCatchSourceInfo()
14413 v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext(); in CheckTryCatchSourceInfo()
14416 v8::Local<v8::Message> message = try_catch.Message(); in CheckTryCatchSourceInfo()
14433 v8::Local<v8::String> source = v8_str( in THREADED_TEST()
14449 v8::Local<v8::Script> script; in THREADED_TEST()
14457 v8::Script::Compile(context.local(), source, &origin1).ToLocalChecked(); in THREADED_TEST()
14464 v8::Script::Compile(context.local(), source, &origin2).ToLocalChecked(); in THREADED_TEST()
14473 CHECK(v8::Script::Compile(context.local(), v8_str("!\n")).IsEmpty()); in THREADED_TEST()
14475 v8::Local<v8::Message> message = try_catch.Message(); in THREADED_TEST()
14476 CHECK_EQ(1, message->GetLineNumber(context.local()).FromJust()); in THREADED_TEST()
14477 CHECK_EQ(0, message->GetStartColumn(context.local()).FromJust()); in THREADED_TEST()
14484 v8::Local<v8::String> source0 = v8_str("1234"); in THREADED_TEST()
14485 v8::Local<v8::String> source1 = v8_str("1234"); in THREADED_TEST()
14486 v8::Local<v8::Script> script0 = CompileWithOrigin(source0, "test.js"); in THREADED_TEST()
14487 v8::Local<v8::Script> script1 = CompileWithOrigin(source1, "test.js"); in THREADED_TEST()
14488 v8::Local<v8::Script> script2 = v8::Script::Compile(context.local(), source0) in THREADED_TEST()
14490 CHECK_EQ(1234, script0->Run(context.local()) in THREADED_TEST()
14492 ->Int32Value(context.local()) in THREADED_TEST()
14494 CHECK_EQ(1234, script1->Run(context.local()) in THREADED_TEST()
14496 ->Int32Value(context.local()) in THREADED_TEST()
14498 CHECK_EQ(1234, script2->Run(context.local()) in THREADED_TEST()
14500 ->Int32Value(context.local()) in THREADED_TEST()
14516 Local<ObjectTemplate> t = ObjectTemplate::New(isolate); in THREADED_TEST()
14520 ->Set(context.local(), v8_str("obj"), in THREADED_TEST()
14521 t->NewInstance(context.local()).ToLocalChecked()) in THREADED_TEST()
14523 v8::Local<v8::Value> value = CompileRun("obj.asdf.name"); in THREADED_TEST()
14533 v8::Local<v8::Value> date = in THREADED_TEST()
14534 v8::Date::New(context.local(), 1224744689038.0).ToLocalChecked(); in THREADED_TEST()
14540 void CheckProperties(v8::Isolate* isolate, v8::Local<v8::Value> val, in CheckProperties()
14542 v8::Local<v8::Context> context = isolate->GetCurrentContext(); in CheckProperties()
14543 v8::Local<v8::Object> obj = val.As<v8::Object>(); in CheckProperties()
14544 v8::Local<v8::Array> props = obj->GetPropertyNames(context).ToLocalChecked(); in CheckProperties()
14554 void CheckOwnProperties(v8::Isolate* isolate, v8::Local<v8::Value> val, in CheckOwnProperties()
14556 v8::Local<v8::Context> context = isolate->GetCurrentContext(); in CheckOwnProperties()
14557 v8::Local<v8::Object> obj = val.As<v8::Object>(); in CheckOwnProperties()
14558 v8::Local<v8::Array> props = in CheckOwnProperties()
14573 v8::Local<v8::Value> obj = CompileRun( in THREADED_TEST()
14582 v8::Local<v8::Array> elms = obj.As<v8::Array>(); in THREADED_TEST()
14588 elms->Get(context.local(), v8::Integer::New(isolate, 0)).ToLocalChecked(), in THREADED_TEST()
14592 elms->Get(context.local(), v8::Integer::New(isolate, 0)).ToLocalChecked(), in THREADED_TEST()
14598 elms->Get(context.local(), v8::Integer::New(isolate, 1)).ToLocalChecked(), in THREADED_TEST()
14602 elms->Get(context.local(), v8::Integer::New(isolate, 1)).ToLocalChecked(), in THREADED_TEST()
14608 elms->Get(context.local(), v8::Integer::New(isolate, 2)).ToLocalChecked(), in THREADED_TEST()
14612 elms->Get(context.local(), v8::Integer::New(isolate, 2)).ToLocalChecked(), in THREADED_TEST()
14618 elms->Get(context.local(), v8::Integer::New(isolate, 3)).ToLocalChecked(), in THREADED_TEST()
14624 elms->Get(context.local(), v8::Integer::New(isolate, 3)).ToLocalChecked(), in THREADED_TEST()
14633 v8::Local<v8::Value> obj = CompileRun( in THREADED_TEST()
14642 v8::Local<v8::Array> elms = obj.As<v8::Array>(); in THREADED_TEST()
14648 elms->Get(context.local(), v8::Integer::New(isolate, 0)).ToLocalChecked(), in THREADED_TEST()
14651 v8::Local<v8::Value> val = in THREADED_TEST()
14652 elms->Get(context.local(), v8::Integer::New(isolate, 0)).ToLocalChecked(); in THREADED_TEST()
14653 v8::Local<v8::Array> props = in THREADED_TEST()
14654 val.As<v8::Object>()->GetPropertyNames(context.local()).ToLocalChecked(); in THREADED_TEST()
14666 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
14685 Local<v8::Object> instance_1 = in THREADED_TEST()
14686 templ->NewInstance(context.local()).ToLocalChecked(); in THREADED_TEST()
14688 ->Set(context.local(), v8_str("obj_1"), instance_1) in THREADED_TEST()
14691 Local<Value> value_1 = CompileRun("obj_1.a"); in THREADED_TEST()
14694 Local<v8::Object> instance_2 = in THREADED_TEST()
14695 templ->NewInstance(context.local()).ToLocalChecked(); in THREADED_TEST()
14697 ->Set(context.local(), v8_str("obj_2"), instance_2) in THREADED_TEST()
14700 Local<Value> value_2 = CompileRun("obj_2.a"); in THREADED_TEST()
14715 v8::ScriptCompiler::Compile(env.local(), &source, in TEST()
14746 ->Set(context.local(), v8_str("tmp"), v8::True(CcTest::isolate())) in THREADED_TEST()
14748 context->Global()->Delete(context.local(), v8_str("tmp")).FromJust(); in THREADED_TEST()
14755 ->Set(context.local(), v8_str("tmp"), v8::True(CcTest::isolate())) in THREADED_TEST()
14757 context->Global()->Delete(context.local(), v8_str("tmp")).FromJust(); in THREADED_TEST()
14768 v8::Local<Context> context0 = Context::New(isolate); in THREADED_TEST()
14769 v8::Local<Context> context1 = Context::New(isolate); in THREADED_TEST()
14772 Local<String> token = v8_str("<security token>"); in THREADED_TEST()
14788 Local<Value> value = CompileRun("var instance = new other.C(); instance.x"); in THREADED_TEST()
14808 Local<Value> val = CompileRun(sample); in TEST()
14810 Local<v8::Object> obj = val.As<v8::Object>(); in TEST()
14811 obj->Set(env.local(), v8_str("gamma"), v8_str("cloneme")).FromJust(); in TEST()
14814 ->Equals(env.local(), in TEST()
14815 obj->Get(env.local(), v8_str("alpha")).ToLocalChecked()) in TEST()
14818 ->Equals(env.local(), in TEST()
14819 obj->Get(env.local(), v8_str("beta")).ToLocalChecked()) in TEST()
14822 ->Equals(env.local(), in TEST()
14823 obj->Get(env.local(), v8_str("gamma")).ToLocalChecked()) in TEST()
14827 Local<v8::Object> clone = obj->Clone(); in TEST()
14829 ->Equals(env.local(), in TEST()
14830 clone->Get(env.local(), v8_str("alpha")).ToLocalChecked()) in TEST()
14833 ->Equals(env.local(), in TEST()
14834 clone->Get(env.local(), v8_str("beta")).ToLocalChecked()) in TEST()
14837 ->Equals(env.local(), in TEST()
14838 clone->Get(env.local(), v8_str("gamma")).ToLocalChecked()) in TEST()
14842 CHECK(clone->Set(env.local(), v8_str("beta"), v8::Integer::New(isolate, 456)) in TEST()
14845 ->Equals(env.local(), in TEST()
14846 obj->Get(env.local(), v8_str("beta")).ToLocalChecked()) in TEST()
14849 ->Equals(env.local(), in TEST()
14850 clone->Get(env.local(), v8_str("beta")).ToLocalChecked()) in TEST()
14919 Local<String> lhs( in THREADED_TEST()
14922 Local<String> rhs( in THREADED_TEST()
14926 CHECK(env->Global()->Set(env.local(), v8_str("lhs"), lhs).FromJust()); in THREADED_TEST()
14927 CHECK(env->Global()->Set(env.local(), v8_str("rhs"), rhs).FromJust()); in THREADED_TEST()
14943 Local<String> cons = in THREADED_TEST()
14944 v8_compile("cons")->Run(env.local()).ToLocalChecked().As<String>(); in THREADED_TEST()
14968 ->Equals(env.local(), env->Global() in THREADED_TEST()
14969 ->Get(env.local(), v8_str("cons")) in THREADED_TEST()
14973 ->Equals(env.local(), env->Global() in THREADED_TEST()
14974 ->Get(env.local(), v8_str("slice")) in THREADED_TEST()
14978 ->Equals(env.local(), in THREADED_TEST()
14980 ->Get(env.local(), v8_str("slice_on_cons")) in THREADED_TEST()
15004 v8::Local<v8::String> source = in TEST()
15007 v8::Script::Compile(context.local(), source).FromMaybe(Local<Script>()); in TEST()
15051 v8::Local<v8::String> string = v8::Local<v8::String>::New( in RunBeforeGC()
15070 v8::Local<v8::String> string = v8_str(one_byte_content); in TEST()
15072 env->Global()->Set(env.local(), v8_str("a"), string).FromJust(); in TEST()
15097 v8::Local<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(isolate); in TEST()
15099 v8::Local<v8::Object> global = context->Global(); in TEST()
15100 v8::Local<v8::Object> global_proto = v8::Local<v8::Object>::Cast( in TEST()
15101 global->Get(context.local(), v8_str("__proto__")).ToLocalChecked()); in TEST()
15102 global_proto->DefineOwnProperty(context.local(), v8_str("x"), in TEST()
15105 global_proto->DefineOwnProperty(context.local(), v8_str("y"), in TEST()
15109 v8::Local<v8::Value> res = in TEST()
15111 CHECK(v8::Integer::New(isolate, 0)->Equals(context.local(), res).FromJust()); in TEST()
15114 CHECK(v8::Integer::New(isolate, 0)->Equals(context.local(), res).FromJust()); in TEST()
15117 CHECK(v8::Integer::New(isolate, 0)->Equals(context.local(), res).FromJust()); in TEST()
15132 v8::Local<v8::Object> obj = v8::Local<v8::Object>::Cast( in TEST()
15133 env->Global()->Get(env.local(), v8_str("a")).ToLocalChecked()); in TEST()
15134 v8::Local<v8::Array> arr = v8::Local<v8::Array>::Cast( in TEST()
15135 env->Global()->Get(env.local(), v8_str("b")).ToLocalChecked()); in TEST()
15139 CHECK(!obj->CreateDataProperty(env.local(), v8_str("foo"), in TEST()
15142 CHECK(obj->CreateDataProperty(env.local(), v8_str("bar"), in TEST()
15145 v8::Local<v8::Value> val = in TEST()
15146 obj->Get(env.local(), v8_str("bar")).ToLocalChecked(); in TEST()
15148 CHECK_EQ(42.0, val->NumberValue(env.local()).FromJust()); in TEST()
15154 CHECK(obj->CreateDataProperty(env.local(), v8_str("blub"), in TEST()
15157 v8::Local<v8::Value> val = in TEST()
15158 obj->Get(env.local(), v8_str("blub")).ToLocalChecked(); in TEST()
15160 CHECK_EQ(42.0, val->NumberValue(env.local()).FromJust()); in TEST()
15166 CHECK(obj->CreateDataProperty(env.local(), v8_str("1"), in TEST()
15169 v8::Local<v8::Value> val = obj->Get(env.local(), 1).ToLocalChecked(); in TEST()
15171 CHECK_EQ(42.0, val->NumberValue(env.local()).FromJust()); in TEST()
15177 CHECK(!arr->CreateDataProperty(env.local(), v8_str("length"), in TEST()
15184 CHECK(arr->CreateDataProperty(env.local(), 1, v8::Integer::New(isolate, 23)) in TEST()
15188 v8::Local<v8::Value> val = arr->Get(env.local(), 1).ToLocalChecked(); in TEST()
15190 CHECK_EQ(23.0, val->NumberValue(env.local()).FromJust()); in TEST()
15193 CHECK(arr->CreateDataProperty(env.local(), 0, v8::Integer::New(isolate, 42)) in TEST()
15196 val = arr->Get(env.local(), 0).ToLocalChecked(); in TEST()
15198 CHECK_EQ(42.0, val->NumberValue(env.local()).FromJust()); in TEST()
15205 CHECK(!obj->CreateDataProperty(env.local(), v8_str("baz"), in TEST()
15210 v8::Local<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(isolate); in TEST()
15212 v8::Local<v8::Object> access_checked = in TEST()
15213 templ->NewInstance(env.local()).ToLocalChecked(); in TEST()
15216 CHECK(access_checked->CreateDataProperty(env.local(), v8_str("foo"), in TEST()
15235 v8::Local<v8::Object> obj = v8::Local<v8::Object>::Cast( in TEST()
15236 env->Global()->Get(env.local(), v8_str("a")).ToLocalChecked()); in TEST()
15237 v8::Local<v8::Array> arr = v8::Local<v8::Array>::Cast( in TEST()
15238 env->Global()->Get(env.local(), v8_str("b")).ToLocalChecked()); in TEST()
15242 CHECK(!obj->DefineOwnProperty(env.local(), v8_str("foo"), in TEST()
15245 CHECK(obj->DefineOwnProperty(env.local(), v8_str("bar"), in TEST()
15248 v8::Local<v8::Value> val = in TEST()
15249 obj->Get(env.local(), v8_str("bar")).ToLocalChecked(); in TEST()
15251 CHECK_EQ(42.0, val->NumberValue(env.local()).FromJust()); in TEST()
15257 CHECK(obj->DefineOwnProperty(env.local(), v8_str("blub"), in TEST()
15260 v8::Local<v8::Value> val = in TEST()
15261 obj->Get(env.local(), v8_str("blub")).ToLocalChecked(); in TEST()
15263 CHECK_EQ(42.0, val->NumberValue(env.local()).FromJust()); in TEST()
15269 CHECK(obj->DefineOwnProperty(env.local(), v8_str("1"), in TEST()
15272 v8::Local<v8::Value> val = obj->Get(env.local(), 1).ToLocalChecked(); in TEST()
15274 CHECK_EQ(42.0, val->NumberValue(env.local()).FromJust()); in TEST()
15280 CHECK(!arr->DefineOwnProperty(env.local(), v8_str("length"), in TEST()
15287 CHECK(arr->DefineOwnProperty(env.local(), v8_str("1"), in TEST()
15291 v8::Local<v8::Value> val = arr->Get(env.local(), 1).ToLocalChecked(); in TEST()
15293 CHECK_EQ(23.0, val->NumberValue(env.local()).FromJust()); in TEST()
15296 CHECK(arr->DefineOwnProperty(env.local(), v8_str("0"), in TEST()
15299 val = arr->Get(env.local(), 0).ToLocalChecked(); in TEST()
15301 CHECK_EQ(42.0, val->NumberValue(env.local()).FromJust()); in TEST()
15307 CHECK(obj->DefineOwnProperty(env.local(), v8_str("lala"), in TEST()
15311 v8::Local<v8::Value> val = in TEST()
15312 obj->Get(env.local(), v8_str("lala")).ToLocalChecked(); in TEST()
15314 CHECK_EQ(42.0, val->NumberValue(env.local()).FromJust()); in TEST()
15316 env.local(), v8_str("lala")).FromJust()); in TEST()
15324 CHECK(!obj->DefineOwnProperty(env.local(), v8_str("baz"), in TEST()
15329 v8::Local<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(isolate); in TEST()
15331 v8::Local<v8::Object> access_checked = in TEST()
15332 templ->NewInstance(env.local()).ToLocalChecked(); in TEST()
15335 CHECK(access_checked->DefineOwnProperty(env.local(), v8_str("foo"), in TEST()
15350 v8::Local<v8::Context> current = v8_isolate->GetCurrentContext(); in THREADED_TEST()
15362 v8::Local<v8::Value> result = CompileRun("var x = 43; x"); in THREADED_TEST()
15364 CHECK_EQ(43, result->Int32Value(context.local()).FromJust()); in THREADED_TEST()
15377 v8::Local<v8::Object> obj = v8::Object::New(isolate); in THREADED_TEST()
15378 v8::Local<v8::FunctionTemplate> func_templ = in THREADED_TEST()
15380 v8::Local<v8::String> foo_string = v8_str("foo"); in THREADED_TEST()
15381 obj->Set(context.local(), foo_string, in THREADED_TEST()
15382 func_templ->GetFunction(context.local()).ToLocalChecked()) in THREADED_TEST()
15384 v8::Local<v8::Object> obj_clone = obj->Clone(); in THREADED_TEST()
15385 obj_clone->Set(context.local(), foo_string, v8_str("Hello")).FromJust(); in THREADED_TEST()
15386 CHECK(!obj->Get(context.local(), foo_string).ToLocalChecked()->IsUndefined()); in THREADED_TEST()
15401 static void ObjectWithExternalArrayTestHelper(Local<Context> context, in ObjectWithExternalArrayTestHelper()
15402 v8::Local<Object> obj, in ObjectWithExternalArrayTestHelper()
15412 v8::Local<v8::Value> result = CompileRun("ext_array.field"); in ObjectWithExternalArrayTestHelper()
15741 v8::Local<v8::Object> obj = v8::Utils::ToLocal(jsobj); in FixedTypedArrayTestHelper()
15744 context.local(), obj, kElementCount, array_type, in FixedTypedArrayTestHelper()
15817 Local<ArrayBufferType> ab = in TypedArrayTestHelper()
15820 Local<TypedArray> ta = in TypedArrayTestHelper()
15826 CHECK(ab->Equals(env.local(), ta->Buffer()).FromJust()); in TypedArrayTestHelper()
15834 env.local(), ta, kElementCount, array_type, low, high); in TypedArrayTestHelper()
15904 Local<v8::ArrayBuffer> ab = in THREADED_TEST()
15906 Local<v8::DataView> dv = v8::DataView::New(ab, 2, kSize); in THREADED_TEST()
15910 CHECK(ab->Equals(env.local(), dv->Buffer()).FromJust()); in THREADED_TEST()
15923 Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(isolate, store_ptr, 8); in THREADED_TEST()
15942 Local<v8::Object> tmp = v8::Object::New(isolate); in THREADED_TEST()
15950 Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(isolate, store_ptr, 8); in THREADED_TEST()
16043 Local<v8::SharedArrayBuffer> ab = in THREADED_TEST()
16045 Local<v8::DataView> dv = in THREADED_TEST()
16050 CHECK(ab->Equals(env.local(), dv->Buffer()).FromJust()); in THREADED_TEST()
16060 Local<Value> result = CompileRun( \
16087 v8::Local<v8::Script> dep = v8_compile(source); in IS_ARRAY_BUFFER_VIEW_TEST()
16092 v8::Local<v8::UnboundScript> indep = in IS_ARRAY_BUFFER_VIEW_TEST()
16096 ->Set(c1.local(), v8::String::NewFromUtf8(c1->GetIsolate(), "foo", in IS_ARRAY_BUFFER_VIEW_TEST()
16102 dep->Run(c1.local()).ToLocalChecked()->Int32Value(c1.local()).FromJust(), in IS_ARRAY_BUFFER_VIEW_TEST()
16105 ->Run(c1.local()) in IS_ARRAY_BUFFER_VIEW_TEST()
16107 ->Int32Value(c1.local()) in IS_ARRAY_BUFFER_VIEW_TEST()
16112 ->Set(c2.local(), v8::String::NewFromUtf8(c2->GetIsolate(), "foo", in IS_ARRAY_BUFFER_VIEW_TEST()
16118 dep->Run(c2.local()).ToLocalChecked()->Int32Value(c2.local()).FromJust(), in IS_ARRAY_BUFFER_VIEW_TEST()
16121 ->Run(c2.local()) in IS_ARRAY_BUFFER_VIEW_TEST()
16123 ->Int32Value(c2.local()) in IS_ARRAY_BUFFER_VIEW_TEST()
16134 v8::Local<v8::String> src = v8_str(source); in THREADED_TEST()
16135 v8::Local<v8::String> origin = v8_str("stack-trace-test"); in THREADED_TEST()
16141 ->Run(context.local()) in THREADED_TEST()
16145 try_catch.StackTrace(context.local()).ToLocalChecked()); in THREADED_TEST()
16154 v8::Local<v8::StackFrame> frame) { in checkStackFrame()
16185 v8::Local<v8::Context> context = args.GetIsolate()->GetCurrentContext(); in AnalyzeStackInNativeCode()
16188 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( in AnalyzeStackInNativeCode()
16202 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( in AnalyzeStackInNativeCode()
16217 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( in AnalyzeStackInNativeCode()
16223 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( in AnalyzeStackInNativeCode()
16229 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( in AnalyzeStackInNativeCode()
16235 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( in AnalyzeStackInNativeCode()
16241 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( in AnalyzeStackInNativeCode()
16255 v8::Local<v8::String> origin = v8_str("capture-stack-trace-test"); in TEST()
16256 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
16272 v8::Local<v8::String> overview_src = v8_str(overview_source); in TEST()
16275 v8::Local<Value> overview_result( in TEST()
16279 ->Run(context.local()) in TEST()
16293 v8::Local<v8::String> detailed_src = v8_str(detailed_source); in TEST()
16295 v8::Local<v8::Integer> line_offset = v8::Integer::New(isolate, 3); in TEST()
16296 v8::Local<v8::Integer> column_offset = v8::Integer::New(isolate, 5); in TEST()
16299 v8::Local<v8::UnboundScript> detailed_script( in TEST()
16302 v8::Local<Value> detailed_result(detailed_script->BindToCurrentContext() in TEST()
16303 ->Run(context.local()) in TEST()
16325 v8::Local<v8::String> function_name_src = in TEST()
16331 v8::Local<Value> function_name_result( in TEST()
16335 ->Run(context.local()) in TEST()
16342 v8::Local<v8::Message> message, v8::Local<Value>) { in StackTraceForUncaughtExceptionListener()
16344 v8::Local<v8::StackTrace> stack_trace = message->GetStackTrace(); in StackTraceForUncaughtExceptionListener()
16369 v8::Local<v8::Object> global = env->Global(); in TEST()
16370 Local<Value> trouble = in TEST()
16371 global->Get(env.local(), v8_str("bar")).ToLocalChecked(); in TEST()
16373 CHECK(Function::Cast(*trouble)->Call(env.local(), global, 0, NULL).IsEmpty()); in TEST()
16396 v8::Local<v8::Object> global = env->Global(); in TEST()
16397 Local<Value> trouble = in TEST()
16398 global->Get(env.local(), v8_str("bar")).ToLocalChecked(); in TEST()
16400 Function::Cast(*trouble)->Call(env.local(), global, 0, NULL).ToLocalChecked(); in TEST()
16433 static void StackTraceFunctionNameListener(v8::Local<v8::Message> message, in StackTraceFunctionNameListener()
16434 v8::Local<Value>) { in StackTraceFunctionNameListener()
16435 v8::Local<v8::StackTrace> stack_trace = message->GetStackTrace(); in StackTraceFunctionNameListener()
16482 static void RethrowStackTraceHandler(v8::Local<v8::Message> message, in RethrowStackTraceHandler()
16483 v8::Local<v8::Value> data) { in RethrowStackTraceHandler()
16485 v8::Local<v8::StackTrace> stack_trace = message->GetStackTrace(); in RethrowStackTraceHandler()
16527 static void RethrowPrimitiveStackTraceHandler(v8::Local<v8::Message> message, in RethrowPrimitiveStackTraceHandler()
16528 v8::Local<v8::Value> data) { in RethrowPrimitiveStackTraceHandler()
16529 v8::Local<v8::StackTrace> stack_trace = message->GetStackTrace(); in RethrowPrimitiveStackTraceHandler()
16564 static void RethrowExistingStackTraceHandler(v8::Local<v8::Message> message, in RethrowExistingStackTraceHandler()
16565 v8::Local<v8::Value> data) { in RethrowExistingStackTraceHandler()
16567 v8::Local<v8::StackTrace> stack_trace = message->GetStackTrace(); in RethrowExistingStackTraceHandler()
16591 static void RethrowBogusErrorStackTraceHandler(v8::Local<v8::Message> message, in RethrowBogusErrorStackTraceHandler()
16592 v8::Local<v8::Value> data) { in RethrowBogusErrorStackTraceHandler()
16594 v8::Local<v8::StackTrace> stack_trace = message->GetStackTrace(); in RethrowBogusErrorStackTraceHandler()
16627 v8::Local<v8::Object> global = CcTest::global(); in PromiseRejectCallback()
16628 v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext(); in PromiseRejectCallback()
16634 v8::Local<v8::Message> message = v8::Exception::CreateMessage( in PromiseRejectCallback()
16636 v8::Local<v8::StackTrace> stack_trace = message->GetStackTrace(); in PromiseRejectCallback()
16665 v8::Local<v8::Promise> GetPromise(const char* name) { in GetPromise()
16666 return v8::Local<v8::Promise>::Cast( in GetPromise()
16673 v8::Local<v8::Value> RejectValue() { in RejectValue()
16689 v8::Local<v8::Object> global = CcTest::global(); in ResetPromiseStates()
16690 v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext(); in ResetPromiseStates()
16733 GetPromise("rejected")->Equals(env.local(), GetPromise("p1")).FromJust()); in TEST()
16734 CHECK(RejectValue()->Equals(env.local(), v8_str("ppp")).FromJust()); in TEST()
16751 GetPromise("rejected")->Equals(env.local(), GetPromise("p2")).FromJust()); in TEST()
16752 CHECK(RejectValue()->Equals(env.local(), v8_str("ppp")).FromJust()); in TEST()
16754 GetPromise("revoked")->Equals(env.local(), GetPromise("p1")).FromJust()); in TEST()
16801 GetPromise("rejected")->Equals(env.local(), GetPromise("q2")).FromJust()); in TEST()
16803 GetPromise("revoked")->Equals(env.local(), GetPromise("q_")).FromJust()); in TEST()
16804 CHECK(RejectValue()->Equals(env.local(), v8_str("qqq")).FromJust()); in TEST()
16820 GetPromise("rejected")->Equals(env.local(), GetPromise("q3")).FromJust()); in TEST()
16821 CHECK(RejectValue()->Equals(env.local(), v8_str("qqqq")).FromJust()); in TEST()
16852 GetPromise("rejected")->Equals(env.local(), GetPromise("r2")).FromJust()); in TEST()
16853 CHECK(RejectValue()->Equals(env.local(), v8_str("rrr")).FromJust()); in TEST()
16865 GetPromise("revoked")->Equals(env.local(), GetPromise("r2")).FromJust()); in TEST()
16866 CHECK(RejectValue()->Equals(env.local(), v8_str("rrr")).FromJust()); in TEST()
16906 CHECK(RejectValue()->Equals(env.local(), v8_str("sss")).FromJust()); in TEST()
17025 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( in AnalyzeStackOfEvalWithSourceURL()
17028 v8::Local<v8::String> url = v8_str("eval_url"); in AnalyzeStackOfEvalWithSourceURL()
17030 v8::Local<v8::String> name = in AnalyzeStackOfEvalWithSourceURL()
17041 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
17073 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( in AnalyzeScriptIdInStack()
17085 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
17090 v8::Local<v8::String> scriptSource = v8_str( in TEST()
17095 v8::Local<v8::Script> script = CompileWithOrigin(scriptSource, "test"); in TEST()
17096 script->Run(context.local()).ToLocalChecked(); in TEST()
17107 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( in AnalyzeStackOfInlineScriptWithSourceURL()
17110 v8::Local<v8::String> url = v8_str("source_url"); in AnalyzeStackOfInlineScriptWithSourceURL()
17112 v8::Local<v8::String> name = in AnalyzeStackOfInlineScriptWithSourceURL()
17123 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
17153 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace( in AnalyzeStackOfDynamicScriptWithSourceURL()
17156 v8::Local<v8::String> url = v8_str("source_url"); in AnalyzeStackOfDynamicScriptWithSourceURL()
17158 v8::Local<v8::String> name = in AnalyzeStackOfDynamicScriptWithSourceURL()
17169 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
17215 try_catch.StackTrace(context.local()).ToLocalChecked()); in TEST()
17237 Local<v8::Message> message = try_catch.Message(); in TEST()
17238 Local<Value> sourceURL = message->GetScriptOrigin().ResourceName(); in TEST()
17260 Local<v8::Message> message = try_catch.Message(); in TEST()
17261 Local<Value> sourceURL = message->GetScriptOrigin().ResourceName(); in TEST()
17322 // Uses the address of a local variable to determine the stack top now.
17349 Local<v8::FunctionTemplate> fun_templ = in TEST()
17351 Local<Function> fun = fun_templ->GetFunction(env.local()).ToLocalChecked(); in TEST()
17353 ->Set(env.local(), v8_str("get_stack_limit"), fun) in TEST()
17373 Local<v8::FunctionTemplate> fun_templ = in TEST()
17375 Local<Function> fun = fun_templ->GetFunction(env.local()).ToLocalChecked(); in TEST()
17377 ->Set(env.local(), v8_str("get_stack_limit"), fun) in TEST()
17411 virtual void VisitExternalString(v8::Local<v8::String> string) { in VisitExternalString()
17442 v8::Local<v8::String> cons = in TEST()
17444 ->ToString(env.local()) in TEST()
17466 v8::Local<v8::String> cons = in TEST()
17468 ->ToString(env.local()) in TEST()
17494 v8::Local<v8::String> string0 = in TEST()
17498 v8::Local<v8::String> string1 = in TEST()
17504 v8::Local<v8::String> string2 = in TEST()
17512 v8::Local<v8::String> string3 = in TEST()
17544 v8::Local<v8::String> ring = in TEST()
17569 v8::Local<v8::String> ring = in TEST()
17570 CompileRun("ring")->ToString(env.local()).ToLocalChecked(); in TEST()
17592 v8::Local<v8::String> ring = CompileRun("ring").As<v8::String>(); in TEST()
17686 v8::Local<v8::Value> number = v8::Number::New(isolate, test_value); in THREADED_TEST()
17687 double stored_number = number->NumberValue(context.local()).FromJust(); in THREADED_TEST()
17706 v8::Local<v8::Value> date = in THREADED_TEST()
17707 v8::Date::New(context.local(), test_value).ToLocalChecked(); in THREADED_TEST()
17709 double stored_date = date->NumberValue(context.local()).FromJust(); in THREADED_TEST()
17748 ->Set(context.local(), v8_str("s"), in THREADED_TEST()
17750 ->GetFunction(context.local()) in THREADED_TEST()
17778 v8::Local<Context> other_context; in TEST()
17790 v8::Local<Context> context = Context::New(isolate); in TEST()
17793 Local<v8::String> obj = v8_str(""); in TEST()
17814 v8::Local<Context> context = Context::New(isolate); in TEST()
17836 v8::Local<Context> context = Context::New(isolate); in TEST()
17842 v8::Local<v8::Message> message = try_catch.Message(); in TEST()
17868 v8::Local<v8::Integer>(), v8::True(env->GetIsolate()), in THREADED_TEST()
17870 v8::Local<v8::String> script = v8_str("function f() {}\n\nfunction g() {}"); in THREADED_TEST()
17871 v8::Script::Compile(env.local(), script, &origin) in THREADED_TEST()
17873 ->Run(env.local()) in THREADED_TEST()
17875 v8::Local<v8::Function> f = v8::Local<v8::Function>::Cast( in THREADED_TEST()
17876 env->Global()->Get(env.local(), v8_str("f")).ToLocalChecked()); in THREADED_TEST()
17877 v8::Local<v8::Function> g = v8::Local<v8::Function>::Cast( in THREADED_TEST()
17878 env->Global()->Get(env.local(), v8_str("g")).ToLocalChecked()); in THREADED_TEST()
17885 script_origin_f.ResourceLineOffset()->Int32Value(env.local()).FromJust()); in THREADED_TEST()
17899 script_origin_g.ResourceLineOffset()->Int32Value(env.local()).FromJust()); in THREADED_TEST()
17912 v8::Local<v8::String> script = in THREADED_TEST()
17914 v8::Script::Compile(env.local(), script, &origin) in THREADED_TEST()
17916 ->Run(env.local()) in THREADED_TEST()
17918 v8::Local<v8::Function> f = v8::Local<v8::Function>::Cast( in THREADED_TEST()
17919 env->Global()->Get(env.local(), v8_str("f")).ToLocalChecked()); in THREADED_TEST()
17971 v8::Script::Compile(env.local(), v8_str(code), &origin) in THREADED_TEST()
17973 ->Run(env.local()) in THREADED_TEST()
17975 v8::Local<v8::Value> error = in THREADED_TEST()
17976 env->Global()->Get(env.local(), v8_str("error")).ToLocalChecked(); in THREADED_TEST()
17977 CHECK_EQ(false, error->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
17990 v8::Local<v8::Function> f = v8::Local<v8::Function>::Cast( in THREADED_TEST()
17992 ->Get(env.local(), in THREADED_TEST()
18039 v8::Script::Compile(env.local(), v8_str(code), &origin) in THREADED_TEST()
18041 ->Run(env.local()) in THREADED_TEST()
18043 v8::Local<v8::Value> error = in THREADED_TEST()
18044 env->Global()->Get(env.local(), v8_str("error")).ToLocalChecked(); in THREADED_TEST()
18045 v8::Local<v8::Function> a = v8::Local<v8::Function>::Cast( in THREADED_TEST()
18046 env->Global()->Get(env.local(), v8_str("a")).ToLocalChecked()); in THREADED_TEST()
18047 v8::Local<v8::Function> b = v8::Local<v8::Function>::Cast( in THREADED_TEST()
18048 env->Global()->Get(env.local(), v8_str("b")).ToLocalChecked()); in THREADED_TEST()
18049 v8::Local<v8::Function> c = v8::Local<v8::Function>::Cast( in THREADED_TEST()
18050 env->Global()->Get(env.local(), v8_str("c")).ToLocalChecked()); in THREADED_TEST()
18051 v8::Local<v8::Function> d = v8::Local<v8::Function>::Cast( in THREADED_TEST()
18052 env->Global()->Get(env.local(), v8_str("d")).ToLocalChecked()); in THREADED_TEST()
18053 v8::Local<v8::Function> e = v8::Local<v8::Function>::Cast( in THREADED_TEST()
18054 env->Global()->Get(env.local(), v8_str("e")).ToLocalChecked()); in THREADED_TEST()
18055 v8::Local<v8::Function> f = v8::Local<v8::Function>::Cast( in THREADED_TEST()
18056 env->Global()->Get(env.local(), v8_str("f")).ToLocalChecked()); in THREADED_TEST()
18057 v8::Local<v8::Function> g = v8::Local<v8::Function>::Cast( in THREADED_TEST()
18058 env->Global()->Get(env.local(), v8_str("g")).ToLocalChecked()); in THREADED_TEST()
18059 CHECK_EQ(false, error->BooleanValue(env.local()).FromJust()); in THREADED_TEST()
18075 v8::Local<v8::String> script = v8_str("function f() {}\n\nfunction g() {}"); in THREADED_TEST()
18076 v8::Script::Compile(env.local(), script, &origin) in THREADED_TEST()
18078 ->Run(env.local()) in THREADED_TEST()
18080 v8::Local<v8::Function> f = v8::Local<v8::Function>::Cast( in THREADED_TEST()
18081 env->Global()->Get(env.local(), v8_str("f")).ToLocalChecked()); in THREADED_TEST()
18082 v8::Local<v8::Function> g = v8::Local<v8::Function>::Cast( in THREADED_TEST()
18083 env->Global()->Get(env.local(), v8_str("g")).ToLocalChecked()); in THREADED_TEST()
18096 v8::Local<v8::String> script = in THREADED_TEST()
18098 v8::Script::Compile(env.local(), script, &origin) in THREADED_TEST()
18100 ->Run(env.local()) in THREADED_TEST()
18102 v8::Local<v8::Function> foo = v8::Local<v8::Function>::Cast( in THREADED_TEST()
18103 env->Global()->Get(env.local(), v8_str("foo")).ToLocalChecked()); in THREADED_TEST()
18104 v8::Local<v8::Function> bar = v8::Local<v8::Function>::Cast( in THREADED_TEST()
18105 env->Global()->Get(env.local(), v8_str("bar")).ToLocalChecked()); in THREADED_TEST()
18115 v8::Local<v8::Function> f; in THREADED_TEST()
18116 f = v8::Local<v8::Function>::Cast(CompileRun("Math.floor")); in THREADED_TEST()
18118 f = v8::Local<v8::Function>::Cast(CompileRun("Object")); in THREADED_TEST()
18120 f = v8::Local<v8::Function>::Cast(CompileRun("Object.__defineSetter__")); in THREADED_TEST()
18122 f = v8::Local<v8::Function>::Cast(CompileRun("Array.prototype.toString")); in THREADED_TEST()
18124 f = v8::Local<v8::Function>::Cast(CompileRun("function a() {}; a;")); in THREADED_TEST()
18136 v8::Local<v8::String> scriptSource = in THREADED_TEST()
18138 v8::Local<v8::Script> script( in THREADED_TEST()
18139 v8::Script::Compile(env.local(), scriptSource, &origin).ToLocalChecked()); in THREADED_TEST()
18140 script->Run(env.local()).ToLocalChecked(); in THREADED_TEST()
18141 v8::Local<v8::Function> foo = v8::Local<v8::Function>::Cast( in THREADED_TEST()
18142 env->Global()->Get(env.local(), v8_str("foo")).ToLocalChecked()); in THREADED_TEST()
18143 v8::Local<v8::Function> bar = v8::Local<v8::Function>::Cast( in THREADED_TEST()
18144 env->Global()->Get(env.local(), v8_str("bar")).ToLocalChecked()); in THREADED_TEST()
18154 v8::Local<v8::String> script = v8_str( in THREADED_TEST()
18160 v8::Script::Compile(env.local(), script, &origin) in THREADED_TEST()
18162 ->Run(env.local()) in THREADED_TEST()
18164 v8::Local<v8::Function> f = v8::Local<v8::Function>::Cast( in THREADED_TEST()
18165 env->Global()->Get(env.local(), v8_str("f")).ToLocalChecked()); in THREADED_TEST()
18166 v8::Local<v8::Function> g = v8::Local<v8::Function>::Cast( in THREADED_TEST()
18167 env->Global()->Get(env.local(), v8_str("g")).ToLocalChecked()); in THREADED_TEST()
18169 Local<v8::Function> original_function = Local<v8::Function>::Cast( in THREADED_TEST()
18172 ->Equals(env.local(), original_function->GetName()) in THREADED_TEST()
18181 Local<String> name, in GetterWhichReturns42()
18190 Local<String> name, in SetterWhichSetsYOnThisTo23()
18191 Local<Value> value, in SetterWhichSetsYOnThisTo23()
18195 Local<Object>::Cast(info.This()) in SetterWhichSetsYOnThisTo23()
18201 void FooGetInterceptor(Local<Name> name, in FooGetInterceptor()
18213 void FooSetInterceptor(Local<Name> name, Local<Value> value, in FooSetInterceptor()
18221 Local<Object>::Cast(info.This()) in FooSetInterceptor()
18231 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
18236 ->Set(context.local(), v8_str("P"), in TEST()
18237 templ->NewInstance(context.local()).ToLocalChecked()) in TEST()
18249 v8::Local<v8::Script> script; in TEST()
18252 v8::Local<v8::Object> c1 = v8::Local<v8::Object>::Cast( in TEST()
18253 script->Run(context.local()).ToLocalChecked()); in TEST()
18254 CHECK_EQ(42, c1->Get(context.local(), v8_str("x")) in TEST()
18256 ->Int32Value(context.local()) in TEST()
18258 CHECK_EQ(23, c1->Get(context.local(), v8_str("y")) in TEST()
18260 ->Int32Value(context.local()) in TEST()
18266 v8::Local<v8::Object> c2 = v8::Local<v8::Object>::Cast( in TEST()
18267 script->Run(context.local()).ToLocalChecked()); in TEST()
18268 CHECK_EQ(42, c2->Get(context.local(), v8_str("x")) in TEST()
18270 ->Int32Value(context.local()) in TEST()
18272 CHECK_EQ(23, c2->Get(context.local(), v8_str("y")) in TEST()
18274 ->Int32Value(context.local()) in TEST()
18281 Local<Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { in NamedPropertyGetterWhichReturns42()
18287 Local<Name> name, Local<Value> value, in NamedPropertySetterWhichSetsYOnThisTo23()
18291 Local<Object>::Cast(info.This()) in NamedPropertySetterWhichSetsYOnThisTo23()
18301 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
18307 ->Set(context.local(), v8_str("P"), in THREADED_TEST()
18308 templ->NewInstance(context.local()).ToLocalChecked()) in THREADED_TEST()
18320 v8::Local<v8::Script> script; in THREADED_TEST()
18323 v8::Local<v8::Object> c1 = v8::Local<v8::Object>::Cast( in THREADED_TEST()
18324 script->Run(context.local()).ToLocalChecked()); in THREADED_TEST()
18325 CHECK_EQ(23, c1->Get(context.local(), v8_str("x")) in THREADED_TEST()
18327 ->Int32Value(context.local()) in THREADED_TEST()
18329 CHECK_EQ(42, c1->Get(context.local(), v8_str("y")) in THREADED_TEST()
18331 ->Int32Value(context.local()) in THREADED_TEST()
18337 v8::Local<v8::Object> c2 = v8::Local<v8::Object>::Cast( in THREADED_TEST()
18338 script->Run(context.local()).ToLocalChecked()); in THREADED_TEST()
18339 CHECK_EQ(23, c2->Get(context.local(), v8_str("x")) in THREADED_TEST()
18341 ->Int32Value(context.local()) in THREADED_TEST()
18343 CHECK_EQ(42, c2->Get(context.local(), v8_str("y")) in THREADED_TEST()
18345 ->Int32Value(context.local()) in THREADED_TEST()
18360 v8::Local<v8::Script> script; in TEST()
18363 v8::Local<v8::Object> prototype = v8::Object::New(isolate); in TEST()
18364 prototype->Set(context.local(), v8_str("y"), v8_num(42)).FromJust(); in TEST()
18366 ->Set(context.local(), v8_str("P"), prototype) in TEST()
18376 v8::Local<v8::Object> c1 = v8::Local<v8::Object>::Cast( in TEST()
18377 script->Run(context.local()).ToLocalChecked()); in TEST()
18378 CHECK_EQ(23, c1->Get(context.local(), v8_str("x")) in TEST()
18380 ->Int32Value(context.local()) in TEST()
18382 CHECK_EQ(42, c1->Get(context.local(), v8_str("y")) in TEST()
18384 ->Int32Value(context.local()) in TEST()
18389 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
18393 ->Set(context.local(), v8_str("P"), in TEST()
18394 templ->NewInstance(context.local()).ToLocalChecked()) in TEST()
18402 v8::Local<v8::Object> c1 = v8::Local<v8::Object>::Cast( in TEST()
18403 script->Run(context.local()).ToLocalChecked()); in TEST()
18404 CHECK_EQ(42, c1->Get(context.local(), v8_str("x")) in TEST()
18406 ->Int32Value(context.local()) in TEST()
18408 CHECK_EQ(23, c1->Get(context.local(), v8_str("y")) in TEST()
18410 ->Int32Value(context.local()) in TEST()
18470 Local<Object> obj = Object::New(isolate); in PrologueCallbackAlloc()
18490 Local<Object> obj = Object::New(isolate); in EpilogueCallbackAlloc()
18589 Local<Value> result = CompileRun(init_code); in THREADED_TEST()
18591 Local<Value> indexof = CompileRun("str2.indexOf('els')"); in THREADED_TEST()
18592 Local<Value> lastindexof = CompileRun("str2.lastIndexOf('dab')"); in THREADED_TEST()
18631 Local<Value> reresult = CompileRun("str2.match(/abel/g).length;"); in THREADED_TEST()
18632 CHECK_EQ(6, reresult->Int32Value(context.local()).FromJust()); in THREADED_TEST()
18636 CHECK_EQ(6, reresult->Int32Value(context.local()).FromJust()); in THREADED_TEST()
18639 CHECK_EQ(1, reresult->Int32Value(context.local()).FromJust()); in THREADED_TEST()
18642 CHECK_EQ(1, reresult->Int32Value(context.local()).FromJust()); in THREADED_TEST()
18666 reresult->Int32Value(context.local()).FromJust()); in THREADED_TEST()
18688 Local<String> string = in TEST()
18699 Local<String> base = v8_str("a"); in TEST()
18700 Local<String> left = base; in TEST()
18701 Local<String> right = base; in TEST()
18706 Local<String> balanced = String::Concat(left, base); in TEST()
18708 Local<String> cons_strings[] = {left, balanced, right}; in TEST()
18709 Local<String> two_byte = in TEST()
18748 void FailedAccessCheckCallbackGC(Local<v8::Object> target, in FailedAccessCheckCallbackGC()
18750 Local<v8::Value> data) { in FailedAccessCheckCallbackGC()
18770 v8::Local<v8::ObjectTemplate> global_template = in TEST()
18777 ->Set(context0.local(), v8_str("x"), v8_num(42)) in TEST()
18779 v8::Local<v8::Object> global0 = context0->Global(); in TEST()
18785 ->Set(context1.local(), v8_str("other"), global0) in TEST()
18826 CHECK(global0->Delete(context1.local(), 0).IsNothing()); in TEST()
18831 CHECK(global0->SetAccessor(context1.local(), v8_str("x"), GetXValue, NULL, in TEST()
18858 CHECK(global0->HasRealIndexedProperty(context1.local(), 0).IsNothing()); in TEST()
18863 global0->HasRealNamedProperty(context1.local(), v8_str("x")).IsNothing()); in TEST()
18867 CHECK(global0->HasRealNamedCallbackProperty(context1.local(), v8_str("x")) in TEST()
18929 v8::Local<v8::Context> context = in BreakArrayGuarantees()
18930 v8::Local<v8::Context>::New(isolate1, context1); in BreakArrayGuarantees()
18978 v8::Local<v8::Context> context = in TEST()
18979 v8::Local<v8::Context>::New(isolate1, context1); in TEST()
18994 v8::Local<v8::Context> context = in TEST()
18995 v8::Local<v8::Context>::New(isolate2, context2); in TEST()
19005 v8::Local<v8::Context> context = in TEST()
19006 v8::Local<v8::Context>::New(isolate1, context1); in TEST()
19025 v8::Local<v8::Context> context = in TEST()
19026 v8::Local<v8::Context>::New(CcTest::isolate(), context_default); in TEST()
19047 v8::Local<v8::Context> context = in TEST()
19048 v8::Local<v8::Context>::New(isolate2, context2); in TEST()
19055 v8::Local<v8::Context> context = in TEST()
19056 v8::Local<v8::Context>::New(v8::Isolate::GetCurrent(), context1); in TEST()
19083 v8::Local<v8::Context> context = in TEST()
19084 v8::Local<v8::Context>::New(CcTest::isolate(), context_default); in TEST()
19101 Local<Value> value = CompileRun(code.start()); in CalcFibonacci()
19103 return static_cast<int>(value->NumberValue(context.local()).FromJust()); in CalcFibonacci()
19154 Local<v8::Context> context; in TEST()
19160 Local<Value> v = CompileRun("2"); in TEST()
19169 Local<Value> v = CompileRun("22"); in TEST()
19394 v8::Local<v8::Value> handle = v8::Local<v8::Value>::New(isolate, *value); in VisitPersistentHandle()
19395 v8::Local<v8::Value> object = v8::Local<v8::Object>::New(isolate, *object_); in VisitPersistentHandle()
19397 CHECK(Local<Object>::Cast(handle) in VisitPersistentHandle()
19469 v8::Local<v8::RegExp> re = in TEST()
19470 v8::RegExp::New(context.local(), v8_str("foo"), v8::RegExp::kNone) in TEST()
19473 CHECK(re->GetSource()->Equals(context.local(), v8_str("foo")).FromJust()); in TEST()
19476 re = v8::RegExp::New(context.local(), v8_str("bar"), in TEST()
19481 CHECK(re->GetSource()->Equals(context.local(), v8_str("bar")).FromJust()); in TEST()
19485 re = v8::RegExp::New(context.local(), v8_str("baz"), in TEST()
19490 CHECK(re->GetSource()->Equals(context.local(), v8_str("baz")).FromJust()); in TEST()
19494 re = v8::RegExp::New(context.local(), v8_str("baz"), in TEST()
19499 CHECK(re->GetSource()->Equals(context.local(), v8_str("baz")).FromJust()); in TEST()
19505 CHECK(re->GetSource()->Equals(context.local(), v8_str("quux")).FromJust()); in TEST()
19510 CHECK(re->GetSource()->Equals(context.local(), v8_str("quux")).FromJust()); in TEST()
19518 re = v8::RegExp::New(context.local(), v8_str("foobar"), v8::RegExp::kNone) in TEST()
19521 CHECK(re->GetSource()->Equals(context.local(), v8_str("foobar")).FromJust()); in TEST()
19524 re = v8::RegExp::New(context.local(), v8_str("foobarbaz"), in TEST()
19530 re->GetSource()->Equals(context.local(), v8_str("foobarbaz")).FromJust()); in TEST()
19534 CHECK(context->Global()->Set(context.local(), v8_str("re"), re).FromJust()); in TEST()
19538 re->Set(context.local(), v8_str("property"), in TEST()
19541 v8::Local<v8::Value> value(CompileRun("re.property")); in TEST()
19542 CHECK_EQ(32, value->Int32Value(context.local()).FromJust()); in TEST()
19545 CHECK(v8::RegExp::New(context.local(), v8_str("foo["), v8::RegExp::kNone) in TEST()
19549 ->Set(context.local(), v8_str("ex"), try_catch.Exception()) in TEST()
19559 v8::Local<v8::Object> globalProxy = localContext->Global(); in THREADED_TEST()
19560 v8::Local<Value> global = globalProxy->GetPrototype(); in THREADED_TEST()
19567 CHECK(global->Equals(localContext.local(), global).FromJust()); in THREADED_TEST()
19568 CHECK(!global->Equals(localContext.local(), globalProxy).FromJust()); in THREADED_TEST()
19569 CHECK(!globalProxy->Equals(localContext.local(), global).FromJust()); in THREADED_TEST()
19570 CHECK(globalProxy->Equals(localContext.local(), globalProxy).FromJust()); in THREADED_TEST()
19574 static void Getter(v8::Local<v8::Name> property, in Getter()
19581 v8::Local<v8::Array> result = v8::Array::New(info.GetIsolate()); in Enumerator()
19593 v8::Context::Scope context_scope(context.local()); in TEST()
19595 v8::Local<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New(isolate); in TEST()
19599 ->Set(context.local(), v8_str("o"), in TEST()
19600 tmpl->NewInstance(context.local()).ToLocalChecked()) in TEST()
19602 v8::Local<v8::Array> result = v8::Local<v8::Array>::Cast( in TEST()
19606 ->Equals(context.local(), in TEST()
19607 result->Get(context.local(), 0).ToLocalChecked()) in TEST()
19615 v8::Local<v8::Object> proxy = context->Global(); in TEST()
19616 v8::Local<v8::Function> define_property = in TEST()
19626 CHECK(define_property->Call(context.local(), proxy, 0, NULL).IsEmpty()); in TEST()
19630 static void InstallContextId(v8::Local<Context> context, int id) { in InstallContextId()
19640 static void CheckContextId(v8::Local<Object> object, int expected) { in CheckContextId()
19641 v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext(); in CheckContextId()
19652 Local<Context> context1 = Context::New(isolate); in THREADED_TEST()
19654 Local<Context> context2 = Context::New(isolate); in THREADED_TEST()
19656 Local<Context> context3 = Context::New(isolate); in THREADED_TEST()
19659 Local<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(isolate); in THREADED_TEST()
19661 Local<Object> object1; in THREADED_TEST()
19662 Local<Function> func1; in THREADED_TEST()
19669 Local<Object> object2; in THREADED_TEST()
19670 Local<Function> func2; in THREADED_TEST()
19677 Local<Object> instance1; in THREADED_TEST()
19678 Local<Object> instance2; in THREADED_TEST()
19687 Local<Context> other_context = Context::New(isolate); in THREADED_TEST()
19739 Local<Context> context = Context::New(CcTest::isolate()); in THREADED_TEST()
19742 Local<Object> function; in THREADED_TEST()
19748 Local<Context> other_context = Context::New(CcTest::isolate()); in THREADED_TEST()
19757 Local<Context> context1 = Context::New(CcTest::isolate()); in THREADED_TEST()
19759 Local<Context> context2 = Context::New(CcTest::isolate()); in THREADED_TEST()
19762 Local<Function> target_function; in THREADED_TEST()
19768 Local<Function> bound_function1, bound_function2; in THREADED_TEST()
19779 Local<Context> other_context = Context::New(CcTest::isolate()); in THREADED_TEST()
19796 Local<Name> property, const v8::PropertyCallbackInfo<v8::Value>& info) { in HasOwnPropertyNamedPropertyGetter()
19811 Local<Name> property, const v8::PropertyCallbackInfo<v8::Integer>& info) { in HasOwnPropertyNamedPropertyQuery()
19820 Local<Name> property, const v8::PropertyCallbackInfo<v8::Integer>& info) { in HasOwnPropertyNamedPropertyQuery2()
19829 Local<String> property, in HasOwnPropertyAccessorGetter()
19840 Local<Value> value = CompileRun( in TEST()
19852 Local<Object> object = value->ToObject(env.local()).ToLocalChecked(); in TEST()
19853 CHECK(object->Has(env.local(), v8_str("foo")).FromJust()); in TEST()
19854 CHECK(!object->HasOwnProperty(env.local(), v8_str("foo")).FromJust()); in TEST()
19855 CHECK(object->HasOwnProperty(env.local(), v8_str("bar")).FromJust()); in TEST()
19856 CHECK(object->Has(env.local(), v8_str("baz")).FromJust()); in TEST()
19857 CHECK(!object->HasOwnProperty(env.local(), v8_str("baz")).FromJust()); in TEST()
19858 CHECK(object->HasOwnProperty(env.local(), v8_str("bla")).FromJust()); in TEST()
19861 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
19864 Local<Object> instance = templ->NewInstance(env.local()).ToLocalChecked(); in TEST()
19865 CHECK(!instance->HasOwnProperty(env.local(), v8_str("42")).FromJust()); in TEST()
19866 CHECK(instance->HasOwnProperty(env.local(), v8_str("foo")).FromJust()); in TEST()
19867 CHECK(!instance->HasOwnProperty(env.local(), v8_str("bar")).FromJust()); in TEST()
19870 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
19873 Local<Object> instance = templ->NewInstance(env.local()).ToLocalChecked(); in TEST()
19874 CHECK(instance->HasOwnProperty(env.local(), v8_str("42")).FromJust()); in TEST()
19875 CHECK(!instance->HasOwnProperty(env.local(), v8_str("43")).FromJust()); in TEST()
19876 CHECK(!instance->HasOwnProperty(env.local(), v8_str("foo")).FromJust()); in TEST()
19879 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
19882 Local<Object> instance = templ->NewInstance(env.local()).ToLocalChecked(); in TEST()
19883 CHECK(instance->HasOwnProperty(env.local(), v8_str("foo")).FromJust()); in TEST()
19884 CHECK(!instance->HasOwnProperty(env.local(), v8_str("bar")).FromJust()); in TEST()
19887 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
19890 Local<Object> instance = templ->NewInstance(env.local()).ToLocalChecked(); in TEST()
19891 CHECK(instance->HasOwnProperty(env.local(), v8_str("42")).FromJust()); in TEST()
19892 CHECK(!instance->HasOwnProperty(env.local(), v8_str("41")).FromJust()); in TEST()
19895 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
19897 Local<Object> instance = templ->NewInstance(env.local()).ToLocalChecked(); in TEST()
19898 CHECK(instance->HasOwnProperty(env.local(), v8_str("foo")).FromJust()); in TEST()
19899 CHECK(!instance->HasOwnProperty(env.local(), v8_str("bar")).FromJust()); in TEST()
19902 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
19906 Local<Object> instance = templ->NewInstance(env.local()).ToLocalChecked(); in TEST()
19907 CHECK(!instance->HasOwnProperty(env.local(), v8_str("foo")).FromJust()); in TEST()
19908 CHECK(instance->HasOwnProperty(env.local(), v8_str("bar")).FromJust()); in TEST()
19916 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
19921 ->Set(context.local(), v8_str("obj"), in TEST()
19922 templ->NewInstance(context.local()).ToLocalChecked()) in TEST()
19926 CHECK(CompileRun("42 in obj")->BooleanValue(context.local()).FromJust()); in TEST()
19927 CHECK(CompileRun("'42' in obj")->BooleanValue(context.local()).FromJust()); in TEST()
19929 CHECK(CompileRun("0 in obj")->BooleanValue(context.local()).FromJust()); in TEST()
19930 CHECK(CompileRun("'0' in obj")->BooleanValue(context.local()).FromJust()); in TEST()
19932 CHECK(!CompileRun("32 in obj")->BooleanValue(context.local()).FromJust()); in TEST()
19933 CHECK(!CompileRun("'32' in obj")->BooleanValue(context.local()).FromJust()); in TEST()
19938 Local<v8::Context> context = CcTest::isolate()->GetCurrentContext(); in CheckCodeGenerationAllowed()
19939 Local<Value> result = CompileRun("eval('42')"); in CheckCodeGenerationAllowed()
19951 Local<Value> result = CompileRun("eval('42')"); in CheckCodeGenerationDisallowed()
19967 bool CodeGenerationAllowed(Local<Context> context) { in CodeGenerationAllowed()
19973 bool CodeGenerationDisallowed(Local<Context> context) { in CodeGenerationDisallowed()
20016 Local<String> message = v8_str("Message"); in TEST()
20017 Local<String> expected_message = v8_str("Uncaught EvalError: Message"); in TEST()
20022 Local<Value> result = CompileRun("eval('42')"); in TEST()
20025 Local<String> actual_message = try_catch.Message()->Get(); in TEST()
20026 CHECK(expected_message->Equals(context.local(), actual_message).FromJust()); in TEST()
20038 Local<FunctionTemplate> templ = in THREADED_TEST()
20040 Local<Function> function = in THREADED_TEST()
20041 templ->GetFunction(context.local()).ToLocalChecked(); in THREADED_TEST()
20043 ->Set(context.local(), v8_str("f"), function) in THREADED_TEST()
20054 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
20057 Local<v8::Object> obj = templ->NewInstance(context.local()).ToLocalChecked(); in THREADED_TEST()
20058 CHECK(context->Global()->Set(context.local(), v8_str("obj"), obj).FromJust()); in THREADED_TEST()
20059 obj->DefineOwnProperty(context.local(), v8_str("1"), v8_str("DONT_CHANGE"), in THREADED_TEST()
20062 obj->Set(context.local(), v8_str("1"), v8_str("foobar")).FromJust(); in THREADED_TEST()
20064 ->Equals(context.local(), in THREADED_TEST()
20065 obj->Get(context.local(), v8_str("1")).ToLocalChecked()) in THREADED_TEST()
20067 obj->DefineOwnProperty(context.local(), v8_str("2"), v8_str("DONT_CHANGE"), in THREADED_TEST()
20070 obj->Set(context.local(), v8_num(2), v8_str("foobar")).FromJust(); in THREADED_TEST()
20072 ->Equals(context.local(), in THREADED_TEST()
20073 obj->Get(context.local(), v8_num(2)).ToLocalChecked()) in THREADED_TEST()
20077 obj->DefineOwnProperty(context.local(), v8_str("2000000000"), in THREADED_TEST()
20080 obj->Set(context.local(), v8_str("2000000000"), v8_str("foobar")).FromJust(); in THREADED_TEST()
20082 ->Equals(context.local(), in THREADED_TEST()
20083 obj->Get(context.local(), v8_str("2000000000")) in THREADED_TEST()
20131 Local<ObjectTemplate> no_proto_template = v8::ObjectTemplate::New(isolate); in THREADED_TEST()
20135 Local<FunctionTemplate> hidden_proto_template = in THREADED_TEST()
20139 Local<FunctionTemplate> protected_hidden_proto_template = in THREADED_TEST()
20146 Local<Context> context = v8::Context::New(isolate); in THREADED_TEST()
20150 Local<Object> simple_object = Object::New(isolate); in THREADED_TEST()
20153 Local<Object> protected_object = in THREADED_TEST()
20157 Local<Object> proxy_object = context->Global(); in THREADED_TEST()
20160 Local<Object> global_object = in THREADED_TEST()
20164 Local<Object> hidden_prototype = hidden_proto_template->GetFunction(context) in THREADED_TEST()
20168 Local<Object> object_with_hidden = in THREADED_TEST()
20176 Local<ObjectTemplate> global_template = ObjectTemplate::New(isolate); in THREADED_TEST()
20185 Local<Value> result1 = CompileRun("Object.getPrototypeOf(simple)"); in THREADED_TEST()
20186 CHECK(result1->Equals(context2.local(), simple_object->GetPrototype()) in THREADED_TEST()
20189 Local<Value> result2 = CompileRun("Object.getPrototypeOf(protected)"); in THREADED_TEST()
20192 Local<Value> result3 = CompileRun("Object.getPrototypeOf(global)"); in THREADED_TEST()
20193 CHECK(result3->Equals(context2.local(), global_object->GetPrototype()) in THREADED_TEST()
20196 Local<Value> result4 = CompileRun("Object.getPrototypeOf(proxy)"); in THREADED_TEST()
20199 Local<Value> result5 = CompileRun("Object.getPrototypeOf(hidden)"); in THREADED_TEST()
20200 CHECK(result5->Equals(context2.local(), object_with_hidden->GetPrototype() in THREADED_TEST()
20201 ->ToObject(context2.local()) in THREADED_TEST()
20208 static void TestReceiver(Local<Value> expected_result, in TestReceiver()
20209 Local<Value> expected_receiver, in TestReceiver()
20211 Local<Value> result = CompileRun(code); in TestReceiver()
20212 Local<Context> context = CcTest::isolate()->GetCurrentContext(); in TestReceiver()
20234 Local<Context> foreign_context = v8::Context::New(isolate); in THREADED_TEST()
20236 Local<Value> foreign_function = in THREADED_TEST()
20251 Local<String> password = v8_str("Password"); in THREADED_TEST()
20257 Local<String> i = v8_str("i"); in THREADED_TEST()
20258 Local<String> o = v8_str("o"); in THREADED_TEST()
20259 Local<String> id = v8_str("id"); in THREADED_TEST()
20271 ->Set(context.local(), v8_str("func"), foreign_function) in THREADED_TEST()
20277 context.local(), in THREADED_TEST()
20278 foreign_context->Global()->Get(context.local(), id).ToLocalChecked()) in THREADED_TEST()
20280 CHECK(o->Equals(context.local(), in THREADED_TEST()
20281 context->Global()->Get(context.local(), id).ToLocalChecked()) in THREADED_TEST()
20284 // Checking local function's receiver. in THREADED_TEST()
20291 o->Equals(context.local(), CompileRun("'abcbd'.replace(/b/,ownfunc)[1]")) in THREADED_TEST()
20294 o->Equals(context.local(), CompileRun("'abcbd'.replace(/b/g,ownfunc)[1]")) in THREADED_TEST()
20297 o->Equals(context.local(), CompileRun("'abcbd'.replace(/b/g,ownfunc)[3]")) in THREADED_TEST()
20320 CHECK(i->Equals(context.local(), CompileRun("'abcbd'.replace(/b/,func)[1]")) in THREADED_TEST()
20322 CHECK(i->Equals(context.local(), CompileRun("'abcbd'.replace(/b/g,func)[1]")) in THREADED_TEST()
20324 CHECK(i->Equals(context.local(), CompileRun("'abcbd'.replace(/b/g,func)[3]")) in THREADED_TEST()
20371 v8::Local<v8::FunctionTemplate> recursive_runtime = in TEST()
20374 ->Set(env.local(), v8_str("recursion"), in TEST()
20375 recursive_runtime->GetFunction(env.local()).ToLocalChecked()) in TEST()
20382 Local<Script> script = in TEST()
20383 v8::Script::Compile(env.local(), v8_str("recursion(0)")).ToLocalChecked(); in TEST()
20384 script->Run(env.local()).ToLocalChecked(); in TEST()
20390 script->Run(env.local()).ToLocalChecked(); in TEST()
20395 Local<Function> recursive_function = Local<Function>::Cast( in TEST()
20396 env->Global()->Get(env.local(), v8_str("recursion")).ToLocalChecked()); in TEST()
20397 v8::Local<Value> args[] = {v8_num(0)}; in TEST()
20398 recursive_function->Call(env.local(), env->Global(), 1, args) in TEST()
20459 CHECK_EQ(0, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20460 CHECK_EQ(0, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20463 Function::New(env.local(), MicrotaskOne).ToLocalChecked()); in TEST()
20465 CHECK_EQ(1, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20466 CHECK_EQ(0, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20469 Function::New(env.local(), MicrotaskOne).ToLocalChecked()); in TEST()
20471 Function::New(env.local(), MicrotaskTwo).ToLocalChecked()); in TEST()
20473 CHECK_EQ(2, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20474 CHECK_EQ(1, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20477 Function::New(env.local(), MicrotaskTwo).ToLocalChecked()); in TEST()
20479 CHECK_EQ(2, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20480 CHECK_EQ(2, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20483 CHECK_EQ(2, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20484 CHECK_EQ(2, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20490 CHECK_EQ(2, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20491 CHECK_EQ(2, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20495 Function::New(env.local(), MicrotaskOne).ToLocalChecked()); in TEST()
20498 Function::New(env.local(), MicrotaskTwo).ToLocalChecked()); in TEST()
20501 CHECK_EQ(3, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20502 CHECK_EQ(3, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20533 Function::New(env.local(), MicrotaskExceptionOne).ToLocalChecked()); in TEST()
20535 Function::New(env.local(), MicrotaskExceptionTwo).ToLocalChecked()); in TEST()
20540 CompileRun("exception1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20542 CompileRun("exception2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20553 CHECK_EQ(0, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20554 CHECK_EQ(0, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20557 Function::New(env.local(), MicrotaskOne).ToLocalChecked()); in TEST()
20559 CHECK_EQ(1, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20560 CHECK_EQ(0, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20564 Function::New(env.local(), MicrotaskOne).ToLocalChecked()); in TEST()
20566 Function::New(env.local(), MicrotaskTwo).ToLocalChecked()); in TEST()
20568 CHECK_EQ(1, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20569 CHECK_EQ(0, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20572 CHECK_EQ(2, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20573 CHECK_EQ(1, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20576 Function::New(env.local(), MicrotaskTwo).ToLocalChecked()); in TEST()
20578 CHECK_EQ(2, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20579 CHECK_EQ(1, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20582 CHECK_EQ(2, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20583 CHECK_EQ(2, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20587 Function::New(env.local(), MicrotaskTwo).ToLocalChecked()); in TEST()
20589 CHECK_EQ(2, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20590 CHECK_EQ(3, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20593 Function::New(env.local(), MicrotaskTwo).ToLocalChecked()); in TEST()
20597 CHECK_EQ(2, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20598 CHECK_EQ(3, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20602 CHECK_EQ(2, CompileRun("ext1Calls")->Int32Value(env.local()).FromJust()); in TEST()
20603 CHECK_EQ(4, CompileRun("ext2Calls")->Int32Value(env.local()).FromJust()); in TEST()
20611 Local<Context> context = Context::New(isolate); in TEST()
20630 Local<Object> exec_state = event_details.GetExecutionState(); in DebugEventInObserver()
20631 Local<Context> context = CcTest::isolate()->GetCurrentContext(); in DebugEventInObserver()
20632 Local<Value> break_id = in DebugEventInObserver()
20635 Local<Function> fun = Local<Function>::Cast( in DebugEventInObserver()
20647 Local<Context> context = Context::New(isolate); in TEST()
20826 Local<String> name, in InstanceCheckedGetter()
20836 static void InstanceCheckedSetter(Local<String> name, in InstanceCheckedSetter()
20837 Local<Value> value, in InstanceCheckedSetter()
20911 Local<FunctionTemplate> templ = FunctionTemplate::New(context->GetIsolate()); in THREADED_TEST()
20912 Local<ObjectTemplate> inst = templ->InstanceTemplate(); in THREADED_TEST()
20914 Local<Value>(), v8::DEFAULT, v8::None, in THREADED_TEST()
20917 ->Set(context.local(), v8_str("f"), in THREADED_TEST()
20918 templ->GetFunction(context.local()).ToLocalChecked()) in THREADED_TEST()
20924 context->Global()->Get(context.local(), v8_str("obj")).ToLocalChecked())); in THREADED_TEST()
20931 context->Global()->Get(context.local(), v8_str("obj")).ToLocalChecked())); in THREADED_TEST()
20937 Local<String> name, const v8::PropertyCallbackInfo<v8::Value>& info) {} in EmptyInterceptorGetter()
20941 Local<String> name, Local<Value> value, in EmptyInterceptorSetter()
20950 Local<FunctionTemplate> templ = FunctionTemplate::New(context->GetIsolate()); in THREADED_TEST()
20951 Local<ObjectTemplate> inst = templ->InstanceTemplate(); in THREADED_TEST()
20955 Local<Value>(), v8::DEFAULT, v8::None, in THREADED_TEST()
20958 ->Set(context.local(), v8_str("f"), in THREADED_TEST()
20959 templ->GetFunction(context.local()).ToLocalChecked()) in THREADED_TEST()
20965 context->Global()->Get(context.local(), v8_str("obj")).ToLocalChecked())); in THREADED_TEST()
20972 context->Global()->Get(context.local(), v8_str("obj")).ToLocalChecked())); in THREADED_TEST()
20982 Local<FunctionTemplate> templ = FunctionTemplate::New(context->GetIsolate()); in THREADED_TEST()
20983 Local<ObjectTemplate> proto = templ->PrototypeTemplate(); in THREADED_TEST()
20985 InstanceCheckedSetter, Local<Value>(), v8::DEFAULT, in THREADED_TEST()
20989 ->Set(context.local(), v8_str("f"), in THREADED_TEST()
20990 templ->GetFunction(context.local()).ToLocalChecked()) in THREADED_TEST()
20996 context->Global()->Get(context.local(), v8_str("obj")).ToLocalChecked())); in THREADED_TEST()
21003 context->Global()->Get(context.local(), v8_str("obj")).ToLocalChecked())); in THREADED_TEST()
21012 context->Global()->Get(context.local(), v8_str("obj")).ToLocalChecked())); in THREADED_TEST()
21034 Local<Message> message = try_catch.Message(); in TEST()
21036 CHECK_EQ(2, message->GetLineNumber(context.local()).FromJust()); in TEST()
21053 Local<Message> message = try_catch.Message(); in TEST()
21055 CHECK_EQ(6, message->GetLineNumber(context.local()).FromJust()); in TEST()
21065 Local<ObjectTemplate> templ = ObjectTemplate::New(context->GetIsolate()); in Helper137002()
21075 ->Set(context.local(), v8_str("obj"), in Helper137002()
21076 templ->NewInstance(context.local()).ToLocalChecked()) in Helper137002()
21104 ->Get(context.local(), v8_str("result")) in Helper137002()
21109 ->Get(context.local(), v8_str("result")) in Helper137002()
21111 ->Int32Value(context.local()) in Helper137002()
21132 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
21137 ->Set(context.local(), v8_str("obj"), in THREADED_TEST()
21138 templ->NewInstance(context.local()).ToLocalChecked()) in THREADED_TEST()
21191 ->Get(context.local(), v8_str("load_result")) in THREADED_TEST()
21195 ->Get(context.local(), v8_str("load_result2")) in THREADED_TEST()
21199 ->Get(context.local(), v8_str("keyed_load_result")) in THREADED_TEST()
21203 ->Get(context.local(), v8_str("keyed_load_result2")) in THREADED_TEST()
21207 ->Get(context.local(), v8_str("y_from_obj")) in THREADED_TEST()
21211 ->Get(context.local(), v8_str("y_from_subobj")) in THREADED_TEST()
21222 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
21227 ->Set(context.local(), v8_str("obj"), in THREADED_TEST()
21228 templ->NewInstance(context.local()).ToLocalChecked()) in THREADED_TEST()
21256 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in THREADED_TEST()
21257 Local<Object> obj = templ->NewInstance(context.local()).ToLocalChecked(); in THREADED_TEST()
21259 obj->DeletePrivate(context.local(), in THREADED_TEST()
21268 Local<Value> set_value = CompileRun("new Set();"); in THREADED_TEST()
21269 Local<Object> set_object(Local<Object>::Cast(set_value)); in THREADED_TEST()
21271 Local<Value> map_value = CompileRun("new Map();"); in THREADED_TEST()
21272 Local<Object> map_object(Local<Object>::Cast(map_value)); in THREADED_TEST()
21281 Local<Object> obj = Object::New(isolate); in THREADED_TEST()
21282 Local<v8::Private> key = v8::Private::New(isolate, v8_str("key")); in THREADED_TEST()
21284 obj->SetPrivate(context.local(), key, v8::Undefined(isolate)).FromJust()); in THREADED_TEST()
21285 Local<Value> value = obj->GetPrivate(context.local(), key).ToLocalChecked(); in THREADED_TEST()
21295 Local<FunctionTemplate> templ = FunctionTemplate::New(isolate, in THREADED_TEST()
21298 Local<Function> function = in THREADED_TEST()
21299 templ->GetFunction(context.local()).ToLocalChecked(); in THREADED_TEST()
21308 Local<Value> obj = in THREADED_TEST()
21311 Local<Object> global = context->Global(); in THREADED_TEST()
21312 global->Set(context.local(), v8_str("obj"), obj).FromJust(); in THREADED_TEST()
21320 Local<Value> obj = in THREADED_TEST()
21322 Local<Object> global = context->Global(); in THREADED_TEST()
21323 global->Set(context.local(), v8_str("obj"), obj).FromJust(); in THREADED_TEST()
21404 v8::Local<v8::ObjectTemplate> global_template = in TEST()
21410 v8::Local<v8::Object> global0 = context0->Global(); in TEST()
21411 global0->Set(context0.local(), v8_str("x"), v8_num(42)).FromJust(); in TEST()
21417 v8::Local<v8::FunctionTemplate> toJSON = in TEST()
21420 global0->Set(context0.local(), v8_str("toJSON"), in TEST()
21421 toJSON->GetFunction(context0.local()).ToLocalChecked()) in TEST()
21428 ->Set(context1.local(), v8_str("other"), global0) in TEST()
21443 void FailedAccessCheckThrows(Local<v8::Object> target, in FailedAccessCheckThrows()
21445 Local<v8::Value> data) { in FailedAccessCheckThrows()
21462 v8::Local<v8::Context> context = args.GetIsolate()->GetCurrentContext(); in HasOwnPropertyCallback()
21501 v8::Local<v8::ObjectTemplate> global_template = in TEST()
21507 v8::Local<v8::Object> global0 = context0->Global(); in TEST()
21513 ->Set(context1.local(), v8_str("other"), global0) in TEST()
21516 v8::Local<v8::FunctionTemplate> catcher_fun = in TEST()
21519 ->Set(context1.local(), v8_str("catcher"), in TEST()
21520 catcher_fun->GetFunction(context1.local()).ToLocalChecked()) in TEST()
21523 v8::Local<v8::FunctionTemplate> has_own_property_fun = in TEST()
21526 ->Set(context1.local(), v8_str("has_own_property"), in TEST()
21527 has_own_property_fun->GetFunction(context1.local()) in TEST()
21660 Local<Function> func = Function::New(env_.local(), ShouldContinueCallback, in TestBody()
21664 ->Set(env_.local(), v8_str("ShouldContinue"), func) in TestBody()
21676 v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate_); in TestBody()
21677 v8::Local<v8::Template> proto = t->PrototypeTemplate(); in TestBody()
21679 Function::New(env_.local(), ShouldContinueCallback, in TestBody()
21683 ->Set(env_.local(), v8_str("Klass"), in TestBody()
21684 t->GetFunction(env_.local()).ToLocalChecked()) in TestBody()
21696 v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate_); in TestBody()
21697 v8::Local<v8::Template> proto = t->PrototypeTemplate(); in TestBody()
21701 ->Set(env_.local(), v8_str("Klass"), in TestBody()
21702 t->GetFunction(env_.local()).ToLocalChecked()) in TestBody()
21714 v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate_); in TestBody()
21721 ->Set(env_.local(), v8_str("Klass"), in TestBody()
21722 t->GetFunction(env_.local()).ToLocalChecked()) in TestBody()
21730 Local<String> property, in ShouldContinueNativeGetter()
21744 v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate_); in TestBody()
21745 v8::Local<v8::Template> proto = t->PrototypeTemplate(); in TestBody()
21747 Function::New(env_.local(), ShouldContinueCallback, in TestBody()
21750 v8::Local<v8::ObjectTemplate> instance_template = t->InstanceTemplate(); in TestBody()
21755 ->Set(env_.local(), v8_str("Klass"), in TestBody()
21756 t->GetFunction(env_.local()).ToLocalChecked()) in TestBody()
21764 Local<Name> property, const v8::PropertyCallbackInfo<v8::Value>& info) {} in EmptyInterceptor()
21773 ->Set(env_.local(), v8_str("WakeUpInterruptor"), in TestBody()
21774 Function::New(env_.local(), WakeUpInterruptorCallback, in TestBody()
21780 ->Set(env_.local(), v8_str("ShouldContinue"), in TestBody()
21781 Function::New(env_.local(), ShouldContinueCallback, in TestBody()
21870 Local<Function> func = Function::New(env_.local(), ShouldContinueCallback, in TestBody()
21874 ->Set(env_.local(), v8_str("ShouldContinue"), func) in TestBody()
21932 static Local<Value> function_new_expected_env;
21946 Local<Object> data = v8::Object::New(isolate); in THREADED_TEST()
21948 Local<Function> func = in THREADED_TEST()
21949 Function::New(env.local(), FunctionNewCallback, data).ToLocalChecked(); in THREADED_TEST()
21950 CHECK(env->Global()->Set(env.local(), v8_str("func"), func).FromJust()); in THREADED_TEST()
21951 Local<Value> result = CompileRun("func();"); in THREADED_TEST()
21952 CHECK(v8::Integer::New(isolate, 17)->Equals(env.local(), result).FromJust()); in THREADED_TEST()
21964 Local<Object> data2 = v8::Object::New(isolate); in THREADED_TEST()
21966 Local<Function> func2 = in THREADED_TEST()
21967 Function::New(env.local(), FunctionNewCallback, data2).ToLocalChecked(); in THREADED_TEST()
21969 CHECK(!func->Equals(env.local(), func2).FromJust()); in THREADED_TEST()
21970 CHECK(env->Global()->Set(env.local(), v8_str("func2"), func2).FromJust()); in THREADED_TEST()
21971 Local<Value> result2 = CompileRun("func2();"); in THREADED_TEST()
21972 CHECK(v8::Integer::New(isolate, 17)->Equals(env.local(), result2).FromJust()); in THREADED_TEST()
21980 Local<String> values[runs]; in TEST()
21983 Local<String> value; in TEST()
21988 Local<String> expected; in TEST()
21991 ->Equals(context.local(), values[i]) in TEST()
22001 Local<String>, Local<Value>, const v8::PropertyCallbackInfo<void>& info) { in SetterWhichExpectsThisAndHolderToDiffer()
22010 Local<ObjectTemplate> templ = ObjectTemplate::New(isolate); in TEST()
22013 ->Set(context.local(), v8_str("P"), in TEST()
22014 templ->NewInstance(context.local()).ToLocalChecked()) in TEST()
22029 static Local<Object> data;
22030 static Local<Object> receiver;
22031 static Local<Object> holder;
22032 static Local<Object> callee;
22075 Local<v8::ObjectTemplate> signature_template; in Run()
22076 Local<v8::Signature> signature; in Run()
22078 Local<v8::FunctionTemplate> parent_template = in Run()
22081 Local<v8::FunctionTemplate> function_template in Run()
22097 Local<v8::Context> context = in Run()
22101 Local<Object> function_receiver = in Run()
22107 Local<Object> inner_global = in Run()
22108 Local<Object>::Cast(context->Global()->GetPrototype()); in Run()
22111 Local<FunctionTemplate> function_template = FunctionTemplate::New( in Run()
22113 Local<Function> function = in Run()
22115 Local<Object> global_holder = inner_global; in Run()
22116 Local<Object> function_holder = function_receiver; in Run()
22118 function_holder = Local<Object>::Cast(function_holder->GetPrototype()); in Run()
22119 global_holder = Local<Object>::Cast(global_holder->GetPrototype()); in Run()
22136 receiver = Local<Object>::Cast(CompileRun( in Run()
22141 receiver = Local<Object>::Cast(CompileRun( in Run()
22203 Local<Object> ApiCallOptimizationChecker::data;
22204 Local<Object> ApiCallOptimizationChecker::receiver;
22205 Local<Object> ApiCallOptimizationChecker::holder;
22206 Local<Object> ApiCallOptimizationChecker::callee;
22222 Local<Object> global = context->Global(); in TEST()
22223 Local<v8::Function> function = in TEST()
22224 Function::New(context.local(), Returns42).ToLocalChecked(); in TEST()
22225 global->Set(context.local(), v8_str("x"), function).FromJust(); in TEST()
22249 Local<Object> global = context->Global(); in TEST()
22250 Local<v8::Function> function = in TEST()
22251 Function::New(context.local(), ReturnsSymbolCallback).ToLocalChecked(); in TEST()
22252 global->Set(context.local(), v8_str("x"), function).FromJust(); in TEST()
22271 ->GetFunction(context.local()) in TEST()
22273 global->Set(context.local(), v8_str("x"), function).FromJust(); in TEST()
22289 CHECK_EQ(21, result->Int32Value(context.local()).FromJust()); in TEST()
22293 CHECK_EQ(21, result->Int32Value(context.local()).FromJust()); in TEST()
22310 auto x = FunctionTemplate::New(isolate, Returns42, Local<Value>(), sig); in TEST()
22311 global->Set(context.local(), v8_str("sig_obj"), in TEST()
22312 sig_obj->GetFunction(context.local()).ToLocalChecked()) in TEST()
22314 global->Set(context.local(), v8_str("x"), in TEST()
22315 x->GetFunction(context.local()).ToLocalChecked()) in TEST()
22332 CHECK_EQ(42, result->Int32Value(context.local()).FromJust()); in TEST()
22338 CHECK_EQ(42, result->Int32Value(context.local()).FromJust()); in TEST()
22355 auto x = FunctionTemplate::New(isolate, Returns42, Local<Value>(), sig); in TEST()
22356 global->Set(context.local(), v8_str("sig_obj"), in TEST()
22357 sig_obj->GetFunction(context.local()).ToLocalChecked()) in TEST()
22359 global->Set(context.local(), v8_str("x"), in TEST()
22360 x->GetFunction(context.local()).ToLocalChecked()) in TEST()
22377 CHECK_EQ(42, result->Int32Value(context.local()).FromJust()); in TEST()
22383 CHECK_EQ(42, result->Int32Value(context.local()).FromJust()); in TEST()
22396 auto x = FunctionTemplate::New(isolate, Returns42, Local<Value>(), sig); in TEST()
22397 global->Set(context.local(), v8_str("sig_obj"), in TEST()
22398 sig_obj->GetFunction(context.local()).ToLocalChecked()) in TEST()
22400 global->Set(context.local(), v8_str("x"), in TEST()
22401 x->GetFunction(context.local()).ToLocalChecked()) in TEST()
22418 CHECK_EQ(42, result->Int32Value(context.local()).FromJust()); in TEST()
22424 CHECK_EQ(42, result->Int32Value(context.local()).FromJust()); in TEST()
22458 Local<v8::Promise::Resolver> pr = in TEST()
22459 v8::Promise::Resolver::New(context.local()).ToLocalChecked(); in TEST()
22460 Local<v8::Promise::Resolver> rr = in TEST()
22461 v8::Promise::Resolver::New(context.local()).ToLocalChecked(); in TEST()
22462 Local<v8::Promise> p = pr->GetPromise(); in TEST()
22463 Local<v8::Promise> r = rr->GetPromise(); in TEST()
22468 Local<Value> o = v8::Object::New(isolate); in TEST()
22472 pr->Resolve(context.local(), v8::Integer::New(isolate, 1)).FromJust(); in TEST()
22474 rr->Reject(context.local(), v8::Integer::New(isolate, 2)).FromJust(); in TEST()
22483 Local<Object> global = context->Global(); in TEST()
22486 Local<v8::Promise::Resolver> pr = in TEST()
22487 v8::Promise::Resolver::New(context.local()).ToLocalChecked(); in TEST()
22488 Local<v8::Promise::Resolver> qr = in TEST()
22489 v8::Promise::Resolver::New(context.local()).ToLocalChecked(); in TEST()
22490 Local<v8::Promise> p = pr->GetPromise(); in TEST()
22491 Local<v8::Promise> q = qr->GetPromise(); in TEST()
22496 pr->Resolve(context.local(), v8::Integer::New(isolate, 1)).FromJust(); in TEST()
22497 qr->Resolve(context.local(), p).FromJust(); in TEST()
22505 Local<Function> f1 = Local<Function>::Cast( in TEST()
22506 global->Get(context.local(), v8_str("f1")).ToLocalChecked()); in TEST()
22507 Local<Function> f2 = Local<Function>::Cast( in TEST()
22508 global->Get(context.local(), v8_str("f2")).ToLocalChecked()); in TEST()
22512 q->Then(context.local(), f1).ToLocalChecked(); in TEST()
22513 CHECK_EQ(0, global->Get(context.local(), v8_str("x1")) in TEST()
22515 ->Int32Value(context.local()) in TEST()
22518 CHECK_EQ(1, global->Get(context.local(), v8_str("x1")) in TEST()
22520 ->Int32Value(context.local()) in TEST()
22525 pr = v8::Promise::Resolver::New(context.local()).ToLocalChecked(); in TEST()
22526 qr = v8::Promise::Resolver::New(context.local()).ToLocalChecked(); in TEST()
22528 qr->Resolve(context.local(), pr).FromJust(); in TEST()
22530 ->Then(context.local(), f1) in TEST()
22532 ->Then(context.local(), f2) in TEST()
22535 CHECK_EQ(0, global->Get(context.local(), v8_str("x1")) in TEST()
22537 ->Int32Value(context.local()) in TEST()
22539 CHECK_EQ(0, global->Get(context.local(), v8_str("x2")) in TEST()
22541 ->Int32Value(context.local()) in TEST()
22544 CHECK_EQ(0, global->Get(context.local(), v8_str("x1")) in TEST()
22546 ->Int32Value(context.local()) in TEST()
22548 CHECK_EQ(0, global->Get(context.local(), v8_str("x2")) in TEST()
22550 ->Int32Value(context.local()) in TEST()
22553 pr->Resolve(context.local(), v8::Integer::New(isolate, 3)).FromJust(); in TEST()
22555 CHECK_EQ(0, global->Get(context.local(), v8_str("x1")) in TEST()
22557 ->Int32Value(context.local()) in TEST()
22559 CHECK_EQ(0, global->Get(context.local(), v8_str("x2")) in TEST()
22561 ->Int32Value(context.local()) in TEST()
22564 CHECK_EQ(3, global->Get(context.local(), v8_str("x1")) in TEST()
22566 ->Int32Value(context.local()) in TEST()
22568 CHECK_EQ(4, global->Get(context.local(), v8_str("x2")) in TEST()
22570 ->Int32Value(context.local()) in TEST()
22616 v8::Local<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(isolate); in TEST()
22619 ->Set(current.local(), v8_str("friend"), in TEST()
22620 templ->NewInstance(current.local()).ToLocalChecked()) in TEST()
22679 Local<Script> script = in TEST()
22680 v8::ScriptCompiler::Compile(env.local(), &script_source).ToLocalChecked(); in TEST()
22681 Local<Value> script_name = script->GetUnboundScript()->GetScriptName(); in TEST()
22690 void CheckMagicComments(Local<Script> script, const char* expected_source_url, in CheckMagicComments()
22709 Local<Script> script = v8_compile(source); in SourceURLHelper()
22788 Local<Object> x = Local<Object>::Cast( in TEST()
22789 env->Global()->Get(env.local(), v8_str("x")).ToLocalChecked()); in TEST()
22790 Local<Value> desc = in TEST()
22791 x->GetOwnPropertyDescriptor(env.local(), v8_str("no_prop")) in TEST()
22795 x->GetOwnPropertyDescriptor(env.local(), v8_str("p0")).ToLocalChecked(); in TEST()
22797 ->Equals(env.local(), Local<Object>::Cast(desc) in TEST()
22798 ->Get(env.local(), v8_str("value")) in TEST()
22802 x->GetOwnPropertyDescriptor(env.local(), v8_str("p1")).ToLocalChecked(); in TEST()
22803 Local<Function> set = in TEST()
22804 Local<Function>::Cast(Local<Object>::Cast(desc) in TEST()
22805 ->Get(env.local(), v8_str("set")) in TEST()
22807 Local<Function> get = in TEST()
22808 Local<Function>::Cast(Local<Object>::Cast(desc) in TEST()
22809 ->Get(env.local(), v8_str("get")) in TEST()
22812 ->Equals(env.local(), in TEST()
22813 get->Call(env.local(), x, 0, NULL).ToLocalChecked()) in TEST()
22815 Local<Value> args[] = {v8_num(14)}; in TEST()
22816 set->Call(env.local(), x, 1, args).ToLocalChecked(); in TEST()
22818 ->Equals(env.local(), in TEST()
22819 get->Call(env.local(), x, 0, NULL).ToLocalChecked()) in TEST()
22827 v8::Local<v8::ObjectTemplate> object_template = in TEST()
22831 v8::Local<Context> context = Context::New(isolate); in TEST()
22845 v8::Local<v8::ObjectTemplate> object_template = in TEST()
22849 v8::Local<Context> context = Context::New(isolate); in TEST()
22852 v8::Local<v8::Object> obj = in TEST()
22866 v8::Local<v8::ObjectTemplate> object_template = in TEST()
22870 v8::Local<Context> context = Context::New(isolate); in TEST()
22953 env.local(), &source, v8_str(full_source), origin); in RunStreamingTest()
22956 v8::Local<Value> result( in RunStreamingTest()
22957 script.ToLocalChecked()->Run(env.local()).ToLocalChecked()); in RunStreamingTest()
22959 CHECK_EQ(13, result->Int32Value(env.local()).FromJust()); in RunStreamingTest()
23228 v8::Local<Script> script = in TEST()
23229 v8::ScriptCompiler::Compile(env.local(), &source, v8_str(full_source), in TEST()
23234 script->Run(env.local()).ToLocalChecked()->Uint32Value(env.local()); in TEST()
23334 v8::Local<Script> script = in TEST()
23335 v8::ScriptCompiler::Compile(env.local(), &source, v8_str(full_source), in TEST()
23342 CHECK(script->Run(env.local()).IsEmpty()); in TEST()
23360 v8::Local<v8::Context> context = v8::Context::New(isolate1); in TEST()
23362 v8::Local<v8::String> source_string = v8_str(source); in TEST()
23380 v8::Local<v8::Context> context = v8::Context::New(isolate2); in TEST()
23382 v8::Local<v8::String> source_string = v8_str(source); in TEST()
23387 v8::Local<v8::Script> script; in TEST()
23414 v8::Local<v8::Context> context = CcTest::isolate()->GetCurrentContext(); in TestInvalidCacheData()
23415 v8::Local<v8::Script> script = in TestInvalidCacheData()
23440 v8::Local<v8::String> source_str = v8_str("function foo() {}"); in TEST()
23442 v8::Local<v8::Script> script = in TEST()
23443 v8::ScriptCompiler::Compile(context.local(), &source, in TEST()
23459 v8::Local<v8::Script> script = in TEST()
23460 v8::ScriptCompiler::Compile(context.local(), &source_with_cached_data, in TEST()
23473 v8::Local<v8::String> incompatible_source_str = in TEST()
23479 v8::Local<v8::Script> script = in TEST()
23480 v8::ScriptCompiler::Compile(context.local(), &source_with_cached_data, in TEST()
23497 v8::Local<v8::String> str = in TEST()
23501 v8::Local<v8::String> result = v8::String::Concat(str, str); in TEST()
23524 v8::Local<v8::ArrayBuffer> result = CompileRun(load).As<v8::ArrayBuffer>(); in TEST()
23550 v8::Local<v8::ObjectTemplate> obj_template = v8::ObjectTemplate::New(isolate); in TEST()
23554 ->Set(env.local(), v8_str("prohibited"), in TEST()
23555 obj_template->NewInstance(env.local()).ToLocalChecked()) in TEST()
23571 Local<FunctionTemplate> t = FunctionTemplate::New(isolate); in TEST()
23573 Local<Object> proto = t->GetFunction(env.local()) in TEST()
23575 ->NewInstance(env.local()) in TEST()
23577 Local<Object> object = Object::New(isolate); in TEST()
23578 Local<Object> proto2 = Object::New(isolate); in TEST()
23579 object->SetPrototype(env.local(), proto).FromJust(); in TEST()
23580 proto->SetPrototype(env.local(), proto2).FromJust(); in TEST()
23582 CHECK(env->Global()->Set(env.local(), v8_str("object"), object).FromJust()); in TEST()
23583 CHECK(env->Global()->Set(env.local(), v8_str("proto"), proto).FromJust()); in TEST()
23584 CHECK(env->Global()->Set(env.local(), v8_str("proto2"), proto2).FromJust()); in TEST()
23586 v8::Local<v8::Value> result = CompileRun("%_GetPrototype(object)"); in TEST()
23587 CHECK(result->Equals(env.local(), proto2).FromJust()); in TEST()
23593 CHECK(result->Equals(env.local(), proto2).FromJust()); in TEST()
23602 Local<Object> result = Local<Object>::Cast( in TEST()
23604 CHECK(env.local() == result->CreationContext()); in TEST()
23676 v8::Local<v8::Object> obj = v8::Object::New(isolate); in TEST()
23693 v8::Local<v8::Object> obj = v8::Object::New(isolate); in TEST()
23703 static bool AccessAlwaysAllowedWithFlag(Local<v8::Context> accessing_context, in AccessAlwaysAllowedWithFlag()
23704 Local<v8::Object> accessed_object) { in AccessAlwaysAllowedWithFlag()
23710 static bool AccessAlwaysBlockedWithFlag(Local<v8::Context> accessing_context, in AccessAlwaysBlockedWithFlag()
23711 Local<v8::Object> accessed_object) { in AccessAlwaysBlockedWithFlag()
23721 v8::Local<Value> value; in TEST()
23724 v8::Local<v8::ObjectTemplate> obj_template = v8::ObjectTemplate::New(isolate); in TEST()
23730 v8::Local<Context> context0 = Context::New(isolate, NULL, obj_template); in TEST()
23732 v8::Local<v8::Object> global0 = context0->Global(); in TEST()
23757 v8::Local<Context> context1 = Context::New(isolate); in TEST()
23759 v8::Local<v8::Object> global1 = context1->Global(); in TEST()
23794 v8::Local<Value> value; in TEST()
23797 v8::Local<v8::ObjectTemplate> obj_template = v8::ObjectTemplate::New(isolate); in TEST()
23803 v8::Local<Context> context0 = Context::New(isolate, NULL, obj_template); in TEST()
23805 v8::Local<v8::Object> global0 = context0->Global(); in TEST()
23830 v8::Local<Context> context1 = Context::New(isolate); in TEST()
23832 v8::Local<v8::Object> global1 = context1->Global(); in TEST()
23867 Local<Function> fun; in TEST()
23870 fun = Local<Function>::Cast(CompileRun( in TEST()
23879 CHECK(fun->Call(env.local(), v8::Undefined(isolate), 0, nullptr).IsEmpty()); in TEST()
23885 v8::Local<Value> args[] = {v8_num(42)}; in TEST()
23886 fun->Call(env.local(), v8::Undefined(isolate), arraysize(args), args) in TEST()
23893 v8::Local<Value> args[] = {v8_num(42), v8_num(555)}; in TEST()
23894 fun->Call(env.local(), v8::Undefined(isolate), arraysize(args), args) in TEST()
23906 Local<Function> fun; in TEST()
23909 fun = Local<Function>::Cast(CompileRun( in TEST()
23919 CHECK(fun->Call(env.local(), v8::Undefined(isolate), 0, nullptr).IsEmpty()); in TEST()
23925 v8::Local<Value> args[] = {v8_num(42)}; in TEST()
23926 fun->Call(env.local(), v8::Undefined(isolate), arraysize(args), args) in TEST()
23933 v8::Local<Value> args[] = {v8_num(42), v8_num(555)}; in TEST()
23934 fun->Call(env.local(), v8::Undefined(isolate), arraysize(args), args) in TEST()
23946 Local<Object> obj; in TEST()
23949 obj = Local<Object>::Cast(CompileRun( in TEST()
23954 obj->DefineOwnProperty(env.local(), v8_str("foo"), v8_num(1), v8::None) in TEST()
23956 obj->DefineOwnProperty(env.local(), v8_str("2"), v8_num(1), v8::None) in TEST()
23958 CHECK(obj->HasOwnProperty(env.local(), v8_str("foo")).FromJust()); in TEST()
23959 CHECK(obj->HasOwnProperty(env.local(), v8_str("2")).FromJust()); in TEST()
23960 CHECK(!obj->Delete(env.local(), v8_str("foo")).FromJust()); in TEST()
23961 CHECK(!obj->Delete(env.local(), 2).FromJust()); in TEST()
23981 v8::Local<v8::Object> binding = env->GetExtrasBindingObject(); in TEST()
23983 auto func = binding->Get(env.local(), v8_str("testExtraShouldReturnFive")) in TEST()
23987 auto result = func->Call(env.local(), undefined, 0, {}) in TEST()
23990 CHECK_EQ(5, result->Int32Value(env.local()).FromJust()); in TEST()
23992 v8::Local<v8::FunctionTemplate> runtimeFunction = in TEST()
23994 binding->Set(env.local(), v8_str("runtime"), in TEST()
23995 runtimeFunction->GetFunction(env.local()).ToLocalChecked()) in TEST()
23997 func = binding->Get(env.local(), v8_str("testExtraShouldCallToRuntime")) in TEST()
24000 result = func->Call(env.local(), undefined, 0, {}) in TEST()
24003 CHECK_EQ(7, result->Int32Value(env.local()).FromJust()); in TEST()
24016 v8::Local<v8::Object> binding = env->GetExtrasBindingObject(); in TEST()
24019 binding->Get(env.local(), v8_str("testExperimentalExtraShouldReturnTen")) in TEST()
24023 auto result = func->Call(env.local(), undefined, 0, {}) in TEST()
24026 CHECK_EQ(10, result->Int32Value(env.local()).FromJust()); in TEST()
24028 v8::Local<v8::FunctionTemplate> runtimeFunction = in TEST()
24030 binding->Set(env.local(), v8_str("runtime"), in TEST()
24031 runtimeFunction->GetFunction(env.local()).ToLocalChecked()) in TEST()
24033 func = binding->Get(env.local(), in TEST()
24037 result = func->Call(env.local(), undefined, 0, {}) in TEST()
24040 CHECK_EQ(7, result->Int32Value(env.local()).FromJust()); in TEST()
24050 v8::Local<v8::Object> binding = env->GetExtrasBindingObject(); in TEST()
24052 auto func = binding->Get(env.local(), v8_str("testExtraCanUseUtils")) in TEST()
24056 auto result = func->Call(env.local(), undefined, 0, {}) in TEST()
24060 auto private_symbol = result->Get(env.local(), v8_str("privateSymbol")) in TEST()
24069 auto fulfilled_promise = result->Get(env.local(), v8_str("fulfilledPromise")) in TEST()
24072 fulfilled_promise->Then(env.local(), store).ToLocalChecked(); in TEST()
24074 CHECK_EQ(1, CompileRun("result")->Int32Value(env.local()).FromJust()); in TEST()
24077 result->Get(env.local(), v8_str("fulfilledPromise2")) in TEST()
24080 fulfilled_promise_2->Then(env.local(), store).ToLocalChecked(); in TEST()
24082 CHECK_EQ(2, CompileRun("result")->Int32Value(env.local()).FromJust()); in TEST()
24084 auto rejected_promise = result->Get(env.local(), v8_str("rejectedPromise")) in TEST()
24087 rejected_promise->Catch(env.local(), store).ToLocalChecked(); in TEST()
24089 CHECK_EQ(3, CompileRun("result")->Int32Value(env.local()).FromJust()); in TEST()
24098 v8::Local<v8::Map> map = v8::Map::New(isolate); in TEST()
24104 v8::Local<v8::Value> val = CompileRun("new Map([[1, 2], [3, 4]])"); in TEST()
24106 map = v8::Local<v8::Map>::Cast(val); in TEST()
24109 v8::Local<v8::Array> contents = map->AsArray(); in TEST()
24113 contents->Get(env.local(), 0).ToLocalChecked().As<v8::Int32>()->Value()); in TEST()
24116 contents->Get(env.local(), 1).ToLocalChecked().As<v8::Int32>()->Value()); in TEST()
24119 contents->Get(env.local(), 2).ToLocalChecked().As<v8::Int32>()->Value()); in TEST()
24122 contents->Get(env.local(), 3).ToLocalChecked().As<v8::Int32>()->Value()); in TEST()
24126 CHECK(map->Has(env.local(), v8::Integer::New(isolate, 1)).FromJust()); in TEST()
24127 CHECK(map->Has(env.local(), v8::Integer::New(isolate, 3)).FromJust()); in TEST()
24129 CHECK(!map->Has(env.local(), v8::Integer::New(isolate, 2)).FromJust()); in TEST()
24130 CHECK(!map->Has(env.local(), map).FromJust()); in TEST()
24132 CHECK_EQ(2, map->Get(env.local(), v8::Integer::New(isolate, 1)) in TEST()
24134 ->Int32Value(env.local()) in TEST()
24136 CHECK_EQ(4, map->Get(env.local(), v8::Integer::New(isolate, 3)) in TEST()
24138 ->Int32Value(env.local()) in TEST()
24141 CHECK(map->Get(env.local(), v8::Integer::New(isolate, 42)) in TEST()
24145 CHECK(!map->Set(env.local(), map, map).IsEmpty()); in TEST()
24147 CHECK(map->Has(env.local(), map).FromJust()); in TEST()
24149 CHECK(map->Delete(env.local(), map).FromJust()); in TEST()
24151 CHECK(!map->Has(env.local(), map).FromJust()); in TEST()
24152 CHECK(!map->Delete(env.local(), map).FromJust()); in TEST()
24164 v8::Local<v8::Set> set = v8::Set::New(isolate); in TEST()
24170 v8::Local<v8::Value> val = CompileRun("new Set([1, 2])"); in TEST()
24172 set = v8::Local<v8::Set>::Cast(val); in TEST()
24175 v8::Local<v8::Array> keys = set->AsArray(); in TEST()
24178 keys->Get(env.local(), 0).ToLocalChecked().As<v8::Int32>()->Value()); in TEST()
24180 keys->Get(env.local(), 1).ToLocalChecked().As<v8::Int32>()->Value()); in TEST()
24184 CHECK(set->Has(env.local(), v8::Integer::New(isolate, 1)).FromJust()); in TEST()
24185 CHECK(set->Has(env.local(), v8::Integer::New(isolate, 2)).FromJust()); in TEST()
24187 CHECK(!set->Has(env.local(), v8::Integer::New(isolate, 3)).FromJust()); in TEST()
24188 CHECK(!set->Has(env.local(), set).FromJust()); in TEST()
24190 CHECK(!set->Add(env.local(), set).IsEmpty()); in TEST()
24192 CHECK(set->Has(env.local(), set).FromJust()); in TEST()
24194 CHECK(set->Delete(env.local(), set).FromJust()); in TEST()
24196 CHECK(!set->Has(env.local(), set).FromJust()); in TEST()
24197 CHECK(!set->Delete(env.local(), set).FromJust()); in TEST()
24207 v8::Local<v8::FunctionTemplate> parent = FunctionTemplate::New(isolate); in TEST()
24208 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, parent); in TEST()
24210 v8::FunctionTemplate::New(isolate, Returns42, Local<Value>(), signature); in TEST()
24212 v8::Local<v8::FunctionTemplate> child = v8::FunctionTemplate::New(isolate); in TEST()
24216 ->Set(env.local(), v8_str("Child"), in TEST()
24217 child->GetFunction(env.local()).ToLocalChecked()) in TEST()
24301 v8::Local<v8::ObjectTemplate> global_template = in TEST()
24310 v8::Local<v8::Object> global_object = env->Global(); in TEST()
24311 v8::Local<v8::Function> foo = v8::Local<v8::Function>::Cast( in TEST()
24312 global_object->Get(env.local(), v8_str("boom")).ToLocalChecked()); in TEST()
24314 CHECK(foo->Call(env.local(), global_object, 0, NULL).IsEmpty()); in TEST()
24327 Local<ObjectTemplate> spreadable_template = v8::ObjectTemplate::New(isolate); in TEST()
24331 Local<Object> object = in TEST()
24332 spreadable_template->NewInstance(env.local()).ToLocalChecked(); in TEST()
24335 CHECK(env->Global()->Set(env.local(), v8_str("object"), object).FromJust()); in TEST()
24336 object->Set(env.local(), v8_str("length"), v8_num(2)).FromJust(); in TEST()
24337 object->Set(env.local(), 0U, v8_str("a")).FromJust(); in TEST()
24338 object->Set(env.local(), 1U, v8_str("b")).FromJust(); in TEST()
24365 Local<ObjectTemplate> object_template = v8::ObjectTemplate::New(isolate); in TEST()
24367 Local<Object> object = in TEST()
24368 object_template->NewInstance(env.local()).ToLocalChecked(); in TEST()
24371 env->Global()->Set(env.local(), v8_str("object"), object).FromJust(); in TEST()
24372 object->Set(env.local(), v8::Symbol::GetToStringTag(isolate), v8_str("hello")) in TEST()
24382 object->ObjectProtoToString(env.local()).ToLocalChecked()); in TEST()
24393 object->ObjectProtoToString(env.local()).ToLocalChecked()); in TEST()
24403 Local<ObjectTemplate> object_template = v8::ObjectTemplate::New(isolate); in TEST()
24406 Local<Object> object = in TEST()
24407 object_template->NewInstance(env.local()).ToLocalChecked(); in TEST()
24409 CHECK(env->Global()->Set(env.local(), v8_str("obj1"), object).FromJust()); in TEST()
24412 auto values = Local<Function>::Cast( in TEST()
24413 object->Get(env.local(), v8_str("values")).ToLocalChecked()); in TEST()
24415 auto ctx = v8::Utils::OpenHandle(*env.local()); in TEST()
24420 Local<Object> object2 = in TEST()
24421 object_template->NewInstance(env2.local()).ToLocalChecked(); in TEST()
24423 env2->Global()->Set(env2.local(), v8_str("obj2"), object2).FromJust()); in TEST()
24425 CHECK_NE(*object->Get(env2.local(), v8_str("values")).ToLocalChecked(), in TEST()
24426 *object2->Get(env2.local(), v8_str("values")).ToLocalChecked()); in TEST()
24428 auto values2 = Local<Function>::Cast( in TEST()
24429 object2->Get(env2.local(), v8_str("values")).ToLocalChecked()); in TEST()
24431 auto ctx2 = v8::Utils::OpenHandle(*env2.local()); in TEST()
24442 v8::Local<v8::Object> target = CompileRun("({})").As<v8::Object>(); in TEST()
24443 v8::Local<v8::Object> handler = CompileRun("({})").As<v8::Object>(); in TEST()
24445 v8::Local<v8::Proxy> proxy = in TEST()
24446 v8::Proxy::New(context.local(), target, handler).ToLocalChecked(); in TEST()