OLD | NEW |
1 // Copyright 2007-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2010 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 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 | 1224 |
1225 v8::Local<v8::String> source_str = v8_str(source); | 1225 v8::Local<v8::String> source_str = v8_str(source); |
1226 v8::ScriptOrigin origin(v8_str("test")); | 1226 v8::ScriptOrigin origin(v8_str("test")); |
1227 v8::ScriptCompiler::Source source(source_str, origin, cache); | 1227 v8::ScriptCompiler::Source source(source_str, origin, cache); |
1228 v8::Local<v8::UnboundScript> script; | 1228 v8::Local<v8::UnboundScript> script; |
1229 { | 1229 { |
1230 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); | 1230 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); |
1231 script = v8::ScriptCompiler::CompileUnbound( | 1231 script = v8::ScriptCompiler::CompileUnbound( |
1232 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); | 1232 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); |
1233 } | 1233 } |
| 1234 CHECK(!cache->rejected); |
1234 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); | 1235 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); |
1235 CHECK(result->ToString()->Equals(v8_str("abcdef"))); | 1236 CHECK(result->ToString()->Equals(v8_str("abcdef"))); |
1236 } | 1237 } |
1237 DCHECK(toplevel_test_code_event_found); | 1238 DCHECK(toplevel_test_code_event_found); |
1238 isolate2->Dispose(); | 1239 isolate2->Dispose(); |
1239 } | 1240 } |
1240 | 1241 |
1241 | 1242 |
1242 TEST(SerializeWithHarmonyScoping) { | 1243 TEST(SerializeWithHarmonyScoping) { |
1243 FLAG_serialize_toplevel = true; | 1244 FLAG_serialize_toplevel = true; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 { | 1296 { |
1296 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); | 1297 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); |
1297 script = v8::ScriptCompiler::CompileUnbound( | 1298 script = v8::ScriptCompiler::CompileUnbound( |
1298 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); | 1299 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); |
1299 } | 1300 } |
1300 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); | 1301 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); |
1301 CHECK(result->ToString()->Equals(v8_str("XY"))); | 1302 CHECK(result->ToString()->Equals(v8_str("XY"))); |
1302 } | 1303 } |
1303 isolate2->Dispose(); | 1304 isolate2->Dispose(); |
1304 } | 1305 } |
OLD | NEW |