Lines Matching refs:context

57       Local<Context> context = Local<Context>::New(isolate, context_);  in ~DeclarationContext()  local
58 context->Exit(); in ~DeclarationContext()
80 virtual void PostInitializeContext(Local<Context> context) {} in PostInitializeContext() argument
125 Local<Context> context = Context::New(isolate, in InitializeIfNeeded() local
129 context_.Reset(isolate, context); in InitializeIfNeeded()
130 context->Enter(); in InitializeIfNeeded()
136 PostInitializeContext(context); in InitializeIfNeeded()
150 Local<Context> context = CcTest::isolate()->GetCurrentContext(); in Check() local
152 context, in Check()
160 MaybeLocal<Value> result = script.ToLocalChecked()->Run(context); in Check()
167 CHECK(value->Equals(context, result.ToLocalChecked()).FromJust()); in Check()
173 CHECK(value->Equals(context, catcher.Exception()).FromJust()); in Check()
183 DeclarationContext* context = GetInstance(info.Data()); in HandleGet() local
184 context->get_count_++; in HandleGet()
185 info.GetReturnValue().Set(context->Get(key)); in HandleGet()
192 DeclarationContext* context = GetInstance(info.Data()); in HandleSet() local
193 context->set_count_++; in HandleSet()
194 info.GetReturnValue().Set(context->Set(key, value)); in HandleSet()
200 DeclarationContext* context = GetInstance(info.Data()); in HandleQuery() local
201 context->query_count_++; in HandleQuery()
202 info.GetReturnValue().Set(context->Query(key)); in HandleQuery()
234 { DeclarationContext context; in TEST() local
235 context.Check("var x; x", in TEST()
240 { DeclarationContext context; in TEST() local
241 context.Check("var x = 0; x", in TEST()
247 { DeclarationContext context; in TEST() local
248 context.Check("function x() { }; x", in TEST()
255 { DeclarationContext context; in TEST() local
256 context.Check("const x; x", in TEST()
261 { DeclarationContext context; in TEST() local
262 context.Check("const x = 0; x", in TEST()
285 { AbsentPropertyContext context; in TEST() local
286 context.Check("var x; x", in TEST()
291 { AbsentPropertyContext context; in TEST() local
292 context.Check("var x = 0; x", in TEST()
298 { AbsentPropertyContext context; in TEST() local
299 context.Check("function x() { }; x", in TEST()
306 { AbsentPropertyContext context; in TEST() local
307 context.Check("const x; x", in TEST()
312 { AbsentPropertyContext context; in TEST() local
313 context.Check("const x = 0; x", in TEST()
318 { AbsentPropertyContext context; in TEST() local
319 context.Check("if (false) { var x = 0 }; x", in TEST()
368 { AppearingPropertyContext context; in TEST() local
369 context.Check("var x; x", in TEST()
374 { AppearingPropertyContext context; in TEST() local
375 context.Check("var x = 0; x", in TEST()
381 { AppearingPropertyContext context; in TEST() local
382 context.Check("function x() { }; x", in TEST()
389 { AppearingPropertyContext context; in TEST() local
390 context.Check("const x; x", in TEST()
395 { AppearingPropertyContext context; in TEST() local
396 context.Check("const x = 0; x", in TEST()
426 { ExistsInPrototypeContext context; in TEST() local
427 context.Check("this.x = 87; this.x", 0, 0, 1, EXPECT_RESULT, in TEST()
431 { ExistsInPrototypeContext context; in TEST() local
432 context.Check("var x; x", in TEST()
439 { ExistsInPrototypeContext context; in TEST() local
440 context.Check("var x = 0; x", in TEST()
447 { ExistsInPrototypeContext context; in TEST() local
448 context.Check("const x; x", in TEST()
455 { ExistsInPrototypeContext context; in TEST() local
456 context.Check("const x = 0; x", in TEST()
484 { AbsentInPrototypeContext context; in TEST() local
485 context.Check("if (false) { var x = 0; }; x", in TEST()
509 virtual void PostInitializeContext(Local<Context> context) { in PostInitializeContext() argument
510 Local<Object> global_object = context->Global(); in PostInitializeContext()
511 Local<Object> hidden_proto = hidden_proto_->GetFunction(context) in PostInitializeContext()
513 ->NewInstance(context) in PostInitializeContext()
517 inner_global->SetPrototype(context, hidden_proto).FromJust(); in PostInitializeContext()
534 { ExistsInHiddenPrototypeContext context; in TEST() local
535 context.Check("var x; x", 0, 0, 0, EXPECT_RESULT, in TEST()
539 { ExistsInHiddenPrototypeContext context; in TEST() local
540 context.Check("var x = 0; x", 0, 0, 0, EXPECT_RESULT, in TEST()
544 { ExistsInHiddenPrototypeContext context; in TEST() local
545 context.Check("function x() { }; x", in TEST()
553 { ExistsInHiddenPrototypeContext context; in TEST() local
554 context.Check("const x; x", 0, 0, 0, EXPECT_RESULT, in TEST()
559 { ExistsInHiddenPrototypeContext context; in TEST() local
560 context.Check("const x = 0; x", 0, 0, 0, EXPECT_RESULT, in TEST()
619 { SimpleContext context; in TEST() local
620 context.Check("var x = 1; x", in TEST()
622 context.Check("var x = 2; x", in TEST()
624 context.Check("const x = 3; x", EXPECT_EXCEPTION); in TEST()
625 context.Check("const x = 4; x", EXPECT_EXCEPTION); in TEST()
626 context.Check("x = 5; x", in TEST()
628 context.Check("var x = 6; x", in TEST()
630 context.Check("this.x", in TEST()
632 context.Check("function x() { return 7 }; x()", in TEST()
636 { SimpleContext context; in TEST() local
637 context.Check("const x = 1; x", in TEST()
639 context.Check("var x = 2; x", // assignment ignored in TEST()
641 context.Check("const x = 3; x", EXPECT_EXCEPTION); in TEST()
642 context.Check("x = 4; x", // assignment ignored in TEST()
644 context.Check("var x = 5; x", // assignment ignored in TEST()
646 context.Check("this.x", in TEST()
648 context.Check("function x() { return 7 }; x", in TEST()
661 SimpleContext context; in TEST() local
662 context.Check("let x = 1; x", EXPECT_RESULT, Number::New(isolate, 1)); in TEST()
663 context.Check("let x = 5; x", EXPECT_EXCEPTION); in TEST()
675 SimpleContext context; in TEST() local
678 context.Check("let x = 1; x", EXPECT_RESULT, Number::New(isolate, 1)); in TEST()
679 context.Check("let z = 4; z", EXPECT_RESULT, Number::New(isolate, 4)); in TEST()
681 context.Check("let z = 1; z", EXPECT_RESULT, Number::New(isolate, 1)); in TEST()
682 context.Check("let x = 4; x", EXPECT_RESULT, Number::New(isolate, 4)); in TEST()
684 context.Check("let y = 2; x", EXPECT_RESULT, in TEST()
704 SimpleContext context; in TEST() local
705 context.Check(decs[i], EXPECT_RESULT, Number::New(isolate, 1)); in TEST()
706 context.Check(decs[i+1], EXPECT_RESULT, Number::New(isolate, 1)); in TEST()
711 SimpleContext context; in TEST() local
712 context.Check("function d0() { return x0 }", // dynamic lookup in TEST()
714 context.Check("this.x0 = -1;" in TEST()
717 context.Check("'use strict';" in TEST()
724 context.Check("'use strict';" in TEST()
750 context.Check("x1 + eval('x1') + (1,eval)('x1') + f1() + g1() + h1();", in TEST()
752 context.Check("o.f() + o.g() + o.h();", in TEST()
754 context.Check("i1() + o.i();", in TEST()
757 context.Check("'use strict';" in TEST()
767 context.Check("x1 + eval('x1') + (1,eval)('x1') + f1() + g1() + h1();", in TEST()
769 context.Check("i1() + j1() + k1();", in TEST()
771 context.Check("i2() + j2() + k2();", in TEST()
773 context.Check("o.f() + o.g() + o.h();", in TEST()
775 context.Check("o.i() + o.j() + o.k();", in TEST()
777 context.Check("i1() + o.i();", in TEST()
780 context.Check("'use strict';" in TEST()
785 context.Check("x0 + eval('x0') + (1,eval)('x0') + " in TEST()
788 context.Check("delete this.x0;" in TEST()
792 context.Check("this.x1 = 666;" in TEST()
795 context.Check("delete this.x1;" in TEST()
802 SimpleContext context; in TEST() local
806 context.Check(script1, EXPECT_EXCEPTION); in TEST()
807 context.Check("this.y1 = 1; this.y2 = 2; 0;", in TEST()
809 context.Check(script1, in TEST()
811 context.Check("'use strict'; let y1 = 3; 0;", in TEST()
813 context.Check(script1, in TEST()
815 context.Check("y1 = 4;", in TEST()
817 context.Check(script1, in TEST()
820 context.Check(script2, in TEST()
822 context.Check("'use strict'; let y2 = 5; 0;", in TEST()
824 context.Check(script1, in TEST()
826 context.Check(script2, in TEST()
835 SimpleContext context; in TEST() local
836 context.Check( in TEST()
844 context.Check( in TEST()
856 SimpleContext context; in TEST() local
858 context.Check("'use strict';" in TEST()
861 context.Check("'use strict';" in TEST()
896 SimpleContext context; in TEST() local
897 context.Check(firsts[i], EXPECT_RESULT, in TEST()
903 context.Check(seconds[j], success_case ? EXPECT_RESULT : EXPECT_EXCEPTION, in TEST()
914 SimpleContext context; in TEST() local
924 context.Check( in TEST()
929 context.Check("h({})", EXPECT_RESULT, undefined_string); in TEST()
930 context.Check( in TEST()
935 context.Check( in TEST()
939 context.Check("f({})", EXPECT_RESULT, Number::New(CcTest::isolate(), 15)); in TEST()
940 context.Check("h({})", EXPECT_RESULT, number_string); in TEST()
948 SimpleContext context; in TEST() local
950 context.Check( in TEST()
955 context.Check( in TEST()
960 context.Check("global.x = 15; x", EXPECT_RESULT, in TEST()
962 context.Check("x = 221; global.x", EXPECT_RESULT, in TEST()
964 context.Check( in TEST()
970 context.Check( in TEST()
974 context.Check( in TEST()
978 context.Check( in TEST()
991 SimpleContext context; in TEST() local
1001 context.Check( in TEST()
1006 context.Check("h({})", EXPECT_RESULT, undefined_string); in TEST()
1007 context.Check( in TEST()
1012 context.Check( in TEST()
1016 context.Check("h({})", EXPECT_RESULT, number_string); in TEST()
1017 context.Check("f({})", EXPECT_RESULT, Number::New(CcTest::isolate(), 15)); in TEST()
1018 context.Check("h({})", EXPECT_RESULT, number_string); in TEST()
1029 SimpleContext context; in TEST() local
1030 context.Check( in TEST()
1036 context.Check( in TEST()
1042 context.Check("g()", EXPECT_RESULT, Number::New(CcTest::isolate(), 5)); in TEST()
1045 context.Check("f()", EXPECT_RESULT, Number::New(CcTest::isolate(), 5)); in TEST()
1047 context.Check("%OptimizeFunctionOnNextCall(g); g()", EXPECT_RESULT, in TEST()
1049 context.Check("%OptimizeFunctionOnNextCall(f); f()", EXPECT_RESULT, in TEST()
1053 SimpleContext context; in TEST() local
1054 context.Check( in TEST()
1060 context.Check("f()", EXPECT_RESULT, Number::New(CcTest::isolate(), 15)); in TEST()
1062 context.Check("%OptimizeFunctionOnNextCall(f); f()", EXPECT_RESULT, in TEST()
1064 context.Check( in TEST()
1070 context.Check("f()", EXPECT_RESULT, Number::New(CcTest::isolate(), 5)); in TEST()
1072 context.Check("%OptimizeFunctionOnNextCall(f); f()", EXPECT_RESULT, in TEST()
1084 SimpleContext context; in TEST() local
1085 context.Check( in TEST()
1092 context.Check( in TEST()
1097 context.Check("global.x", EXPECT_RESULT, in TEST()
1100 context.Check("g(31); x", EXPECT_RESULT, in TEST()
1103 context.Check("global.x", EXPECT_RESULT, in TEST()
1106 context.Check("f(32); x", EXPECT_RESULT, in TEST()
1109 context.Check("global.x", EXPECT_RESULT, in TEST()
1111 context.Check("%OptimizeFunctionOnNextCall(g); g(18); x", EXPECT_RESULT, in TEST()
1113 context.Check("global.x", EXPECT_RESULT, in TEST()
1115 context.Check("%OptimizeFunctionOnNextCall(f); f(33); x", EXPECT_RESULT, in TEST()
1117 context.Check("global.x", EXPECT_RESULT, in TEST()
1121 SimpleContext context; in TEST() local
1122 context.Check( in TEST()
1129 context.Check("f(18); x", EXPECT_RESULT, in TEST()
1132 context.Check("%OptimizeFunctionOnNextCall(f); f(20); x", EXPECT_RESULT, in TEST()
1134 context.Check( in TEST()
1139 context.Check("global.x", EXPECT_RESULT, in TEST()
1142 context.Check("f(13); x", EXPECT_RESULT, in TEST()
1145 context.Check("global.x", EXPECT_RESULT, in TEST()
1147 context.Check("%OptimizeFunctionOnNextCall(f); f(41); x", EXPECT_RESULT, in TEST()
1149 context.Check("global.x", EXPECT_RESULT, in TEST()
1161 SimpleContext context; in TEST() local
1163 context.Check("function f() { x = 27; }", EXPECT_RESULT, in TEST()
1165 context.Check("'use strict';const x = 1; x", EXPECT_RESULT, in TEST()
1167 context.Check("f();", EXPECT_EXCEPTION); in TEST()
1168 context.Check("x", EXPECT_RESULT, Number::New(CcTest::isolate(), 1)); in TEST()
1169 context.Check("f();", EXPECT_EXCEPTION); in TEST()
1170 context.Check("x", EXPECT_RESULT, Number::New(CcTest::isolate(), 1)); in TEST()
1171 context.Check("%OptimizeFunctionOnNextCall(f);f();", EXPECT_EXCEPTION); in TEST()
1172 context.Check("x", EXPECT_RESULT, Number::New(CcTest::isolate(), 1)); in TEST()
1183 SimpleContext context; in TEST() local
1185 context.Check("'use strict'; o; const o = 10", EXPECT_EXCEPTION); in TEST()
1188 context.Check("o.prototype", EXPECT_EXCEPTION); in TEST()
1200 SimpleContext context; in TEST() local
1201 context.Check("function f() { x = 1; }", EXPECT_RESULT, in TEST()
1203 context.Check("'use strict'; f(); let x = 2; x", EXPECT_EXCEPTION); in TEST()
1209 SimpleContext context; in TEST() local
1210 context.Check("function f() { x = 1; }", EXPECT_RESULT, in TEST()
1213 context.Check("f(); x", EXPECT_RESULT, Number::New(CcTest::isolate(), 1)); in TEST()
1215 context.Check("'use strict'; f(); let x = 2; x", EXPECT_EXCEPTION); in TEST()
1221 SimpleContext context; in TEST() local
1222 context.Check("function f() { x = 1; }", EXPECT_RESULT, in TEST()
1225 context.Check("f(); x", EXPECT_RESULT, Number::New(CcTest::isolate(), 1)); in TEST()
1227 context.Check("%OptimizeFunctionOnNextCall(f); f(); x", EXPECT_RESULT, in TEST()
1230 context.Check("'use strict'; f(); let x = 2; x", EXPECT_EXCEPTION); in TEST()
1241 SimpleContext context; in TEST() local
1242 context.Check("function f() { return x; }", EXPECT_RESULT, in TEST()
1244 context.Check("'use strict'; f(); let x = 2; x", EXPECT_EXCEPTION); in TEST()
1250 SimpleContext context; in TEST() local
1251 context.Check("function f() { return x; }", EXPECT_RESULT, in TEST()
1254 context.Check("f()", EXPECT_EXCEPTION); in TEST()
1256 context.Check("'use strict'; f(); let x = 2; x", EXPECT_EXCEPTION); in TEST()
1262 SimpleContext context; in TEST() local
1263 context.Check("function f() { return x; }", EXPECT_RESULT, in TEST()
1266 context.Check("f()", EXPECT_EXCEPTION); in TEST()
1268 context.Check("%OptimizeFunctionOnNextCall(f);", EXPECT_RESULT, in TEST()
1271 context.Check("'use strict'; f(); let x = 2; x", EXPECT_EXCEPTION); in TEST()