Index: Source/bindings/v8/ScriptPreprocessor.cpp |
diff --git a/Source/bindings/v8/ScriptPreprocessor.cpp b/Source/bindings/v8/ScriptPreprocessor.cpp |
index 9fc3cee9c058ce306bab0cdde0cecfa96dcc89cb..3c38767e8ffbc55ab850394a067bee858fc18bf7 100644 |
--- a/Source/bindings/v8/ScriptPreprocessor.cpp |
+++ b/Source/bindings/v8/ScriptPreprocessor.cpp |
@@ -49,12 +49,13 @@ ScriptPreprocessor::ScriptPreprocessor(const ScriptSourceCode& preprocessorSourc |
RefPtr<DOMWrapperWorld> world = DOMWrapperWorld::ensureIsolatedWorld(ScriptPreprocessorIsolatedWorldId, DOMWrapperWorld::mainWorldExtensionGroup); |
m_scriptState = ScriptState::from(toV8Context(frame, *world)); |
+ v8::HandleScope handleScope(m_scriptState->isolate()); |
ASSERT(frame); |
v8::TryCatch tryCatch; |
tryCatch.SetVerbose(true); |
Vector<ScriptSourceCode> sources; |
sources.append(preprocessorSourceCode); |
- Vector<ScriptValue> scriptResults; |
+ Vector<v8::Local<v8::Value> > scriptResults; |
frame->script().executeScriptInIsolatedWorld(ScriptPreprocessorIsolatedWorldId, sources, DOMWrapperWorld::mainWorldExtensionGroup, &scriptResults); |
if (scriptResults.size() != 1) { |
@@ -62,12 +63,12 @@ ScriptPreprocessor::ScriptPreprocessor(const ScriptSourceCode& preprocessorSourc |
return; |
} |
- ScriptValue preprocessorFunction = scriptResults[0]; |
- if (!preprocessorFunction.isFunction()) { |
+ v8::Local<v8::Value> preprocessorFunction = scriptResults[0]; |
+ if (preprocessorFunction.IsEmpty() || !preprocessorFunction->IsFunction()) { |
frame->console().addMessage(JSMessageSource, ErrorMessageLevel, "The preprocessor must compile to a function."); |
return; |
} |
- m_preprocessorFunction.set(m_scriptState->isolate(), v8::Handle<v8::Function>::Cast(preprocessorFunction.v8Value())); |
+ m_preprocessorFunction.set(m_scriptState->isolate(), v8::Handle<v8::Function>::Cast(preprocessorFunction)); |
} |
String ScriptPreprocessor::preprocessSourceCode(const String& sourceCode, const String& sourceName) |