| 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,
|
|
|