Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1028)

Unified Diff: test/cctest/cctest.h

Issue 203353002: New compilation API, part 2. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/preparser.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/cctest.h
diff --git a/test/cctest/cctest.h b/test/cctest/cctest.h
index 93195102d4a99d2b5fa7c40dbb8ee90e7098f0c4..6359835235c069d8e2807ce667151775381aa7f1 100644
--- a/test/cctest/cctest.h
+++ b/test/cctest/cctest.h
@@ -316,8 +316,9 @@ static inline v8::Local<v8::Script> v8_compile(v8::Local<v8::String> x) {
static inline v8::Local<v8::Script> CompileWithOrigin(
v8::Local<v8::String> source, v8::Local<v8::String> origin_url) {
v8::ScriptOrigin origin(origin_url);
+ v8::ScriptCompiler::Source script_source(source, origin);
return v8::ScriptCompiler::Compile(
- v8::Isolate::GetCurrent(), v8::ScriptCompiler::Source(source, origin));
+ v8::Isolate::GetCurrent(), &script_source);
}
@@ -350,11 +351,11 @@ static inline v8::Local<v8::Value> PreCompileCompileRun(const char* source) {
v8::String::NewFromUtf8(isolate, source);
v8::ScriptData* preparse = v8::ScriptData::PreCompile(source_string);
v8::ScriptCompiler::Source script_source(
- source_string, v8::ScriptCompiler::CachedData(
+ source_string, new v8::ScriptCompiler::CachedData(
reinterpret_cast<const uint8_t*>(preparse->Data()),
preparse->Length()));
- v8::Local<v8::Script> script = v8::ScriptCompiler::Compile(
- isolate, v8::ScriptCompiler::Source(script_source));
+ v8::Local<v8::Script> script =
+ v8::ScriptCompiler::Compile(isolate, &script_source);
v8::Local<v8::Value> result = script->Run();
delete preparse;
return result;
@@ -370,18 +371,17 @@ static inline v8::Local<v8::Value> CompileRunWithOrigin(const char* source,
v8::ScriptOrigin origin(v8_str(origin_url),
v8::Integer::New(isolate, line_number),
v8::Integer::New(isolate, column_number));
- return v8::ScriptCompiler::Compile(
- isolate, v8::ScriptCompiler::Source(v8_str(source), origin))
- ->Run();
+ v8::ScriptCompiler::Source script_source(v8_str(source), origin);
+ return v8::ScriptCompiler::Compile(isolate, &script_source)->Run();
}
static inline v8::Local<v8::Value> CompileRunWithOrigin(
v8::Local<v8::String> source, const char* origin_url) {
- v8::ScriptOrigin origin(v8_str(origin_url));
- return v8::ScriptCompiler::Compile(
- v8::Isolate::GetCurrent(),
- v8::ScriptCompiler::Source(source, origin))->Run();
+ v8::ScriptCompiler::Source script_source(
+ source, v8::ScriptOrigin(v8_str(origin_url)));
+ return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &script_source)
+ ->Run();
}
« no previous file with comments | « src/preparser.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698