From 8ee40e408bc51e3ef66112f6ec460a3eb4e35b9b Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 12 Aug 2014 12:03:07 -0500 Subject: [PATCH] Fixes for v8 3.17.10 (0x031710) --- Tools/javascript/v8_shell.cxx | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/Tools/javascript/v8_shell.cxx b/Tools/javascript/v8_shell.cxx index 4c6334f2f..5148d32d8 100644 --- a/Tools/javascript/v8_shell.cxx +++ b/Tools/javascript/v8_shell.cxx @@ -70,7 +70,13 @@ V8Shell::~V8Shell() {} bool V8Shell::RunScript(const std::string& scriptPath) { if (!context.IsEmpty()) { +#if (V8_VERSION < 0x031710) context.Dispose(); +#elif (V8_VERSION < 0x031900) + context.Dispose(v8::Isolate::GetCurrent()); +#else + context.Dispose(); +#endif } std::string source = ReadFile(scriptPath); @@ -85,7 +91,15 @@ bool V8Shell::RunScript(const std::string& scriptPath) { bool success = _ExecuteScript(source, scriptPath); context->Exit(); - context.Dispose(); + +#if (V8_VERSION < 0x031710) + context.Dispose(); +#elif (V8_VERSION < 0x031900) + context.Dispose(v8::Isolate::GetCurrent()); +#else + context.Dispose(); +#endif + v8::V8::Dispose(); return true; @@ -112,7 +126,13 @@ bool V8Shell::_ExecuteScript(const std::string& source, const std::string& scrip bool V8Shell::RunShell() { if (!context.IsEmpty()) { +#if (V8_VERSION < 0x031710) + context.Dispose(); +#elif (V8_VERSION < 0x031900) + context.Dispose(v8::Isolate::GetCurrent()); +#else context.Dispose(); +#endif } context = CreateShellContext(); @@ -139,7 +159,13 @@ bool V8Shell::RunShell() { printf("\n"); context->Exit(); +#if (V8_VERSION < 0x031710) + context.Dispose(); +#elif (V8_VERSION < 0x031900) + context.Dispose(v8::Isolate::GetCurrent()); +#else context.Dispose(); +#endif v8::V8::Dispose(); return true;