| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 } | 545 } |
| 546 | 546 |
| 547 | 547 |
| 548 THREADED_TEST(AccessorPropertyCrossContext) { | 548 THREADED_TEST(AccessorPropertyCrossContext) { |
| 549 LocalContext env; | 549 LocalContext env; |
| 550 v8::Isolate* isolate = env->GetIsolate(); | 550 v8::Isolate* isolate = env->GetIsolate(); |
| 551 v8::HandleScope scope(isolate); | 551 v8::HandleScope scope(isolate); |
| 552 v8::Handle<v8::Function> fun = v8::Function::New(isolate, check_contexts); | 552 v8::Handle<v8::Function> fun = v8::Function::New(isolate, check_contexts); |
| 553 LocalContext switch_context; | 553 LocalContext switch_context; |
| 554 switch_context->Global()->Set(v8_str("fun"), fun); | 554 switch_context->Global()->Set(v8_str("fun"), fun); |
| 555 v8::TryCatch try_catch; | 555 v8::TryCatch try_catch(isolate); |
| 556 expected_current_context = env.local(); | 556 expected_current_context = env.local(); |
| 557 expected_calling_context = switch_context.local(); | 557 expected_calling_context = switch_context.local(); |
| 558 CompileRun( | 558 CompileRun( |
| 559 "var o = Object.create(null, { n: { get:fun } });" | 559 "var o = Object.create(null, { n: { get:fun } });" |
| 560 "for (var i = 0; i < 10; i++) o.n;"); | 560 "for (var i = 0; i < 10; i++) o.n;"); |
| 561 CHECK(!try_catch.HasCaught()); | 561 CHECK(!try_catch.HasCaught()); |
| 562 } | 562 } |
| 563 | 563 |
| 564 | 564 |
| 565 THREADED_TEST(GlobalObjectAccessor) { | 565 THREADED_TEST(GlobalObjectAccessor) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 | 681 |
| 682 security_check_value = true; | 682 security_check_value = true; |
| 683 ExpectInt32("f()", 907); | 683 ExpectInt32("f()", 907); |
| 684 security_check_value = false; | 684 security_check_value = false; |
| 685 { | 685 { |
| 686 v8::TryCatch try_catch(isolate); | 686 v8::TryCatch try_catch(isolate); |
| 687 CompileRun("f();"); | 687 CompileRun("f();"); |
| 688 CHECK(try_catch.HasCaught()); | 688 CHECK(try_catch.HasCaught()); |
| 689 } | 689 } |
| 690 } | 690 } |
| OLD | NEW |