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 8261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8272 env2_global->TurnOnAccessCheck(); | 8272 env2_global->TurnOnAccessCheck(); |
8273 env2->DetachGlobal(); | 8273 env2->DetachGlobal(); |
8274 | 8274 |
8275 Local<Value> result; | 8275 Local<Value> result; |
8276 result = CompileRun("bound_x()"); | 8276 result = CompileRun("bound_x()"); |
8277 CHECK(v8_str("env2_x")->Equals(result)); | 8277 CHECK(v8_str("env2_x")->Equals(result)); |
8278 result = CompileRun("get_x()"); | 8278 result = CompileRun("get_x()"); |
8279 CHECK(result.IsEmpty()); | 8279 CHECK(result.IsEmpty()); |
8280 result = CompileRun("get_x_w()"); | 8280 result = CompileRun("get_x_w()"); |
8281 CHECK(result.IsEmpty()); | 8281 CHECK(result.IsEmpty()); |
8282 result = CompileRun("this_x()"); | 8282 { |
8283 CHECK(v8_str("env2_x")->Equals(result)); | 8283 v8::TryCatch try_catch(env1->GetIsolate()); |
| 8284 CompileRun("this_x()"); |
| 8285 CHECK(try_catch.HasCaught()); |
| 8286 } |
8284 | 8287 |
8285 // Reattach env2's proxy | 8288 // Reattach env2's proxy |
8286 env2 = Context::New(env1->GetIsolate(), | 8289 env2 = Context::New(env1->GetIsolate(), |
8287 0, | 8290 0, |
8288 v8::Handle<v8::ObjectTemplate>(), | 8291 v8::Handle<v8::ObjectTemplate>(), |
8289 env2_global); | 8292 env2_global); |
8290 env2->SetSecurityToken(foo); | 8293 env2->SetSecurityToken(foo); |
8291 { | 8294 { |
8292 v8::Context::Scope scope(env2); | 8295 v8::Context::Scope scope(env2); |
8293 env2->Global()->Set(v8_str("x"), v8_str("env3_x")); | 8296 env2->Global()->Set(v8_str("x"), v8_str("env3_x")); |
(...skipping 13453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21747 } | 21750 } |
21748 { | 21751 { |
21749 v8::TryCatch try_catch; | 21752 v8::TryCatch try_catch; |
21750 uint16_t* data = reinterpret_cast<uint16_t*>(buffer); | 21753 uint16_t* data = reinterpret_cast<uint16_t*>(buffer); |
21751 CHECK(v8::String::NewFromTwoByte(isolate, data, v8::String::kNormalString, | 21754 CHECK(v8::String::NewFromTwoByte(isolate, data, v8::String::kNormalString, |
21752 length).IsEmpty()); | 21755 length).IsEmpty()); |
21753 CHECK(!try_catch.HasCaught()); | 21756 CHECK(!try_catch.HasCaught()); |
21754 } | 21757 } |
21755 free(buffer); | 21758 free(buffer); |
21756 } | 21759 } |
OLD | NEW |