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

Unified Diff: test/cctest/cctest.h

Issue 185653004: Experimental parser: merge to r19637 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 10 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 | « test/cctest/OWNERS ('k') | test/cctest/cctest.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 6d2c552ac6ca5ef8786b7a11234343cdfc35d3b8..a4991a5a19711f8d71c2a38a151b9c953d815aac 100644
--- a/test/cctest/cctest.h
+++ b/test/cctest/cctest.h
@@ -130,6 +130,10 @@ class CcTest {
CcTestExtensionFlags extensions,
v8::Isolate* isolate = CcTest::isolate());
+ static void TearDown() {
+ if (isolate_ != NULL) isolate_->Dispose();
+ }
+
private:
friend int main(int argc, char** argv);
TestFunction* callback_;
@@ -311,6 +315,18 @@ static inline v8::Local<v8::Value> CompileRun(const char* source) {
}
+static inline v8::Local<v8::Value> PreCompileCompileRun(const char* source) {
+ v8::Local<v8::String> script_source =
+ v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), source);
+ v8::ScriptData* preparse = v8::ScriptData::PreCompile(script_source);
+ v8::Local<v8::Script> script =
+ v8::Script::Compile(script_source, NULL, preparse);
+ v8::Local<v8::Value> result = script->Run();
+ delete preparse;
+ return result;
+}
+
+
// Helper function that compiles and runs the source with given origin.
static inline v8::Local<v8::Value> CompileRunWithOrigin(const char* source,
const char* origin_url,
« no previous file with comments | « test/cctest/OWNERS ('k') | test/cctest/cctest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698