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 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); | 1232 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); |
1233 } | 1233 } |
1234 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); | 1234 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); |
1235 CHECK(result->ToString()->Equals(v8_str("abcdef"))); | 1235 CHECK(result->ToString()->Equals(v8_str("abcdef"))); |
1236 } | 1236 } |
1237 DCHECK(toplevel_test_code_event_found); | 1237 DCHECK(toplevel_test_code_event_found); |
1238 isolate2->Dispose(); | 1238 isolate2->Dispose(); |
1239 } | 1239 } |
1240 | 1240 |
1241 | 1241 |
1242 TEST(Bug3628) { | 1242 TEST(SerializeWithHarmonyScoping) { |
1243 FLAG_serialize_toplevel = true; | 1243 FLAG_serialize_toplevel = true; |
1244 FLAG_harmony_scoping = true; | 1244 FLAG_harmony_scoping = true; |
1245 | 1245 |
1246 const char* source1 = "'use strict'; let x = 'X'"; | 1246 const char* source1 = "'use strict'; let x = 'X'"; |
1247 const char* source2 = "'use strict'; let y = 'Y'"; | 1247 const char* source2 = "'use strict'; let y = 'Y'"; |
1248 const char* source3 = "'use strict'; x + y"; | 1248 const char* source3 = "'use strict'; x + y"; |
1249 | 1249 |
1250 v8::ScriptCompiler::CachedData* cache; | 1250 v8::ScriptCompiler::CachedData* cache; |
1251 | 1251 |
1252 v8::Isolate* isolate1 = v8::Isolate::New(); | 1252 v8::Isolate* isolate1 = v8::Isolate::New(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 { | 1295 { |
1296 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); | 1296 DisallowCompilation no_compile(reinterpret_cast<Isolate*>(isolate2)); |
1297 script = v8::ScriptCompiler::CompileUnbound( | 1297 script = v8::ScriptCompiler::CompileUnbound( |
1298 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); | 1298 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache); |
1299 } | 1299 } |
1300 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); | 1300 v8::Local<v8::Value> result = script->BindToCurrentContext()->Run(); |
1301 CHECK(result->ToString()->Equals(v8_str("XY"))); | 1301 CHECK(result->ToString()->Equals(v8_str("XY"))); |
1302 } | 1302 } |
1303 isolate2->Dispose(); | 1303 isolate2->Dispose(); |
1304 } | 1304 } |
OLD | NEW |