From 41f0590a9d7d627783a1b11c86808959928fc1a6 Mon Sep 17 00:00:00 2001 From: John Abd-El-Malek Date: Tue, 20 May 2014 09:52:29 -0700 Subject: Remove "using namespace v8" in header. This allows us to turn all warnings into errors. It also makes it clearer to find usage of v8 in the library. --- fpdfsdk/include/javascript/JS_Define.h | 22 +++--- fpdfsdk/include/jsapi/fxjs_v8.h | 9 ++- fpdfsdk/src/javascript/JS_Context.cpp | 4 +- fpdfsdk/src/javascript/JS_Object.cpp | 2 +- fpdfsdk/src/javascript/JS_Runtime.cpp | 4 +- fpdfsdk/src/jsapi/fxjs_v8.cpp | 122 ++++++++++++++++----------------- 6 files changed, 81 insertions(+), 82 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/include/javascript/JS_Define.h b/fpdfsdk/include/javascript/JS_Define.h index c86289e640..81d44550c4 100644 --- a/fpdfsdk/include/javascript/JS_Define.h +++ b/fpdfsdk/include/javascript/JS_Define.h @@ -23,14 +23,14 @@ struct JSConstSpec struct JSPropertySpec { const wchar_t* pName; - AccessorGetterCallback pPropGet; - AccessorSetterCallback pPropPut; + v8::AccessorGetterCallback pPropGet; + v8::AccessorSetterCallback pPropPut; }; struct JSMethodSpec { const wchar_t* pName; - FunctionCallback pMethodCall; + v8::FunctionCallback pMethodCall; unsigned nParamNum; }; @@ -100,7 +100,7 @@ typedef CFX_WideString JS_ErrorString; v8::Local v = context->GetEmbedderData(1);\ ASSERT(!v.IsEmpty());\ if(v.IsEmpty()) return;\ - v8::Handle field = v8::Handle::Cast(v);\ + v8::Handle field = v8::Handle::Cast(v);\ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\ IFXJS_Context* cc = pRuntime->GetCurrentContext();\ CJS_PropValue value(isolate);\ @@ -146,7 +146,7 @@ typedef CFX_WideString JS_ErrorString; v8::Local v = context->GetEmbedderData(1);\ ASSERT(!v.IsEmpty());\ if(v.IsEmpty()) return;\ - v8::Handle field = v8::Handle::Cast(v);\ + v8::Handle field = v8::Handle::Cast(v);\ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\ IFXJS_Context* cc = pRuntime->GetCurrentContext();\ CJS_PropValue propValue(CJS_Value(isolate,value,VT_unknown));\ @@ -197,7 +197,7 @@ JS_STATIC_PROP_SET(prop_name, class_name) v8::Local v = context->GetEmbedderData(1);\ ASSERT(!v.IsEmpty());\ if(v.IsEmpty()) return;\ - v8::Handle field = v8::Handle::Cast(v);\ + v8::Handle field = v8::Handle::Cast(v);\ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\ IFXJS_Context* cc = pRuntime->GetCurrentContext();\ CJS_Parameters parameters;\ @@ -403,7 +403,7 @@ const wchar_t * js_class_name::m_pClassName = JS_WIDESTRING(class_name);\ v8::Local v = context->GetEmbedderData(1);\ ASSERT(!v.IsEmpty());\ if(v.IsEmpty()) return;\ - v8::Handle field = v8::Handle::Cast(v);\ + v8::Handle field = v8::Handle::Cast(v);\ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\ IFXJS_Context* cc = pRuntime->GetCurrentContext();\ v8::String::Utf8Value utf8_value(property);\ @@ -451,7 +451,7 @@ const wchar_t * js_class_name::m_pClassName = JS_WIDESTRING(class_name);\ v8::Local v = context->GetEmbedderData(1);\ ASSERT(!v.IsEmpty());\ if(v.IsEmpty()) return;\ - v8::Handle field = v8::Handle::Cast(v);\ + v8::Handle field = v8::Handle::Cast(v);\ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\ IFXJS_Context* cc = pRuntime->GetCurrentContext();\ v8::String::Utf8Value utf8_value(property);\ @@ -498,7 +498,7 @@ const wchar_t * js_class_name::m_pClassName = JS_WIDESTRING(class_name);\ v8::Local v = context->GetEmbedderData(1);\ ASSERT(!v.IsEmpty());\ if(v.IsEmpty()) return;\ - v8::Handle field = v8::Handle::Cast(v);\ + v8::Handle field = v8::Handle::Cast(v);\ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\ IFXJS_Context* cc = pRuntime->GetCurrentContext();\ v8::String::Utf8Value utf8_value(property);\ @@ -598,7 +598,7 @@ void js_class_name::GetMethods(JSMethodSpec*& pMethods, int& nSize)\ v8::Local v = context->GetEmbedderData(1);\ ASSERT(!v.IsEmpty());\ if(v.IsEmpty()) return;\ - v8::Handle field = v8::Handle::Cast(v);\ + v8::Handle field = v8::Handle::Cast(v);\ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\ IFXJS_Context* cc = pRuntime->GetCurrentContext();\ CJS_Parameters parameters;\ @@ -651,7 +651,7 @@ static void fun_name##_static(JS_METHOD_ARGS)\ v8::Local v = context->GetEmbedderData(1);\ ASSERT(!v.IsEmpty());\ if(v.IsEmpty()) return;\ - v8::Handle field = v8::Handle::Cast(v);\ + v8::Handle field = v8::Handle::Cast(v);\ IFXJS_Runtime* pRuntime = (IFXJS_Runtime*)field->Value();\ IFXJS_Context* cc = pRuntime->GetCurrentContext();\ CJS_Parameters parameters;\ diff --git a/fpdfsdk/include/jsapi/fxjs_v8.h b/fpdfsdk/include/jsapi/fxjs_v8.h index 7e8e655a6e..3ea5054e17 100644 --- a/fpdfsdk/include/jsapi/fxjs_v8.h +++ b/fpdfsdk/include/jsapi/fxjs_v8.h @@ -8,7 +8,6 @@ #define FXJSAPI_H #include -using namespace v8; enum FXJSOBJTYPE { @@ -63,11 +62,11 @@ typedef unsigned (*LP_DESTRUCTOR)(JS_DESTRUCTOR_ARGS); #endif int JS_DefineObj(IJS_Runtime* pJSRuntime, const wchar_t* sObjName, FXJSOBJTYPE eObjType, LP_CONSTRUCTOR pConstructor, LP_DESTRUCTOR pDestructor, unsigned bApplyNew); -int JS_DefineObjMethod(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sMethodName, FunctionCallback pMethodCall, unsigned nParamNum); -int JS_DefineObjProperty(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sPropName, AccessorGetterCallback pPropGet, AccessorSetterCallback pPropPut); -int JS_DefineObjAllProperties(IJS_Runtime* pJSRuntime, int nObjDefnID, NamedPropertyQueryCallback pPropQurey, NamedPropertyGetterCallback pPropGet, NamedPropertySetterCallback pPropPut, NamedPropertyDeleterCallback pPropDel); +int JS_DefineObjMethod(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sMethodName, v8::FunctionCallback pMethodCall, unsigned nParamNum); +int JS_DefineObjProperty(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sPropName, v8::AccessorGetterCallback pPropGet, v8::AccessorSetterCallback pPropPut); +int JS_DefineObjAllProperties(IJS_Runtime* pJSRuntime, int nObjDefnID, v8::NamedPropertyQueryCallback pPropQurey, v8::NamedPropertyGetterCallback pPropGet, v8::NamedPropertySetterCallback pPropPut, v8::NamedPropertyDeleterCallback pPropDel); int JS_DefineObjConst(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sConstName, v8::Handle pDefault); -int JS_DefineGlobalMethod(IJS_Runtime* pJSRuntime, const wchar_t* sMethodName, FunctionCallback pMethodCall, unsigned nParamNum); +int JS_DefineGlobalMethod(IJS_Runtime* pJSRuntime, const wchar_t* sMethodName, v8::FunctionCallback pMethodCall, unsigned nParamNum); int JS_DefineGlobalConst(IJS_Runtime* pJSRuntime, const wchar_t* sConstName, v8::Handle pDefault); void JS_InitialRuntime(IJS_Runtime* pJSRuntime,IFXJS_Runtime* pFXRuntime, IFXJS_Context* context, v8::Persistent& v8PersistentContext); diff --git a/fpdfsdk/src/javascript/JS_Context.cpp b/fpdfsdk/src/javascript/JS_Context.cpp index 21acf59180..c0d4e0847e 100644 --- a/fpdfsdk/src/javascript/JS_Context.cpp +++ b/fpdfsdk/src/javascript/JS_Context.cpp @@ -116,7 +116,7 @@ FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideStri FX_BOOL CJS_Context::RunScript(const CFX_WideString& script, CFX_WideString& info) { v8::Isolate::Scope isolate_scope(m_pRuntime->GetIsolate()); - HandleScope handle_scope(m_pRuntime->GetIsolate()); + v8::HandleScope handle_scope(m_pRuntime->GetIsolate()); v8::Local context = m_pRuntime->NewJSContext(); v8::Context::Scope context_scope(context); @@ -126,7 +126,7 @@ FX_BOOL CJS_Context::RunScript(const CFX_WideString& script, CFX_WideString& inf FX_BOOL CJS_Context::Compile(const CFX_WideString& script, CFX_WideString& info) { v8::Isolate::Scope isolate_scope(m_pRuntime->GetIsolate()); - HandleScope handle_scope(m_pRuntime->GetIsolate()); + v8::HandleScope handle_scope(m_pRuntime->GetIsolate()); v8::Local context = m_pRuntime->NewJSContext(); v8::Context::Scope context_scope(context); diff --git a/fpdfsdk/src/javascript/JS_Object.cpp b/fpdfsdk/src/javascript/JS_Object.cpp index 07c5df2525..3830b2ac53 100644 --- a/fpdfsdk/src/javascript/JS_Object.cpp +++ b/fpdfsdk/src/javascript/JS_Object.cpp @@ -88,7 +88,7 @@ FX_BOOL CJS_EmbedObj::IsSafeMode(IFXJS_Context* cc) } /* --------------------------------- CJS_Object --------------------------------- */ -void FreeObject(const WeakCallbackData& data) +void FreeObject(const v8::WeakCallbackData& data) { CJS_Object* pJSObj = data.GetParameter(); if(pJSObj) diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp index dc95d530f9..e707269da2 100644 --- a/fpdfsdk/src/javascript/JS_Runtime.cpp +++ b/fpdfsdk/src/javascript/JS_Runtime.cpp @@ -134,7 +134,7 @@ CJS_Runtime::~CJS_Runtime() FX_BOOL CJS_Runtime::InitJSObjects() { v8::Isolate::Scope isolate_scope(GetIsolate()); - HandleScope handle_scope(GetIsolate()); + v8::HandleScope handle_scope(GetIsolate()); v8::Handle context = v8::Context::New(GetIsolate()); v8::Context::Scope context_scope(context); //0 - 8 @@ -207,7 +207,7 @@ void CJS_Runtime::SetReaderDocument(CPDFSDK_Document* pReaderDoc) if (m_pDocument != pReaderDoc) { v8::Isolate::Scope isolate_scope(m_isolate); - HandleScope handle_scope(m_isolate); + v8::HandleScope handle_scope(m_isolate); v8::Local context =v8::Local::New(m_isolate, m_context); v8::Context::Scope context_scope(context); diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp index bbf9eec67d..8b8849b42d 100644 --- a/fpdfsdk/src/jsapi/fxjs_v8.cpp +++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp @@ -41,9 +41,9 @@ public: objName(sObjName), objType(eObjType), m_pConstructor(pConstructor), m_pDestructor(pDestructor),m_bApplyNew(bApplyNew),m_bSetAsGlobalObject(FALSE) { v8::Isolate::Scope isolate_scope(isolate); - HandleScope handle_scope(isolate); + v8::HandleScope handle_scope(isolate); - v8::Handle objTemplate = ObjectTemplate::New(isolate); + v8::Handle objTemplate = v8::ObjectTemplate::New(isolate); objTemplate->SetInternalFieldCount(1); m_objTemplate.Reset(isolate, objTemplate); @@ -67,7 +67,7 @@ public: unsigned m_bApplyNew; FX_BOOL m_bSetAsGlobalObject; - v8::Persistent m_objTemplate; + v8::Persistent m_objTemplate; v8::Persistent m_StaticObj; }; @@ -75,7 +75,7 @@ int JS_DefineObj(IJS_Runtime* pJSRuntime, const wchar_t* sObjName, FXJSOBJTYPE e { v8::Isolate* isolate = (v8::Isolate*)pJSRuntime; v8::Isolate::Scope isolate_scope(isolate); - HandleScope handle_scope(isolate); + v8::HandleScope handle_scope(isolate); CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0); if(!pArray) { @@ -87,11 +87,11 @@ int JS_DefineObj(IJS_Runtime* pJSRuntime, const wchar_t* sObjName, FXJSOBJTYPE e return pArray->GetSize()-1; } -int JS_DefineObjMethod(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sMethodName, FunctionCallback pMethodCall, unsigned nParamNum) +int JS_DefineObjMethod(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sMethodName, v8::FunctionCallback pMethodCall, unsigned nParamNum) { v8::Isolate* isolate = (v8::Isolate*)pJSRuntime; v8::Isolate::Scope isolate_scope(isolate); - HandleScope handle_scope(isolate); + v8::HandleScope handle_scope(isolate); CFX_WideString ws = CFX_WideString((FX_LPCWSTR)sMethodName); CFX_ByteString bsMethodName = ws.UTF8Encode(); @@ -101,17 +101,17 @@ int JS_DefineObjMethod(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* s if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return 0; CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID); - v8::Local objTemp = v8::Local::New(isolate, pObjDef->m_objTemplate); - objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsMethodName)), FunctionTemplate::New(isolate, pMethodCall), ReadOnly); + v8::Local objTemp = v8::Local::New(isolate, pObjDef->m_objTemplate); + objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsMethodName)), v8::FunctionTemplate::New(isolate, pMethodCall), v8::ReadOnly); pObjDef->m_objTemplate.Reset(isolate,objTemp); return 0; } -int JS_DefineObjProperty(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sPropName, AccessorGetterCallback pPropGet, AccessorSetterCallback pPropPut) +int JS_DefineObjProperty(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sPropName, v8::AccessorGetterCallback pPropGet, v8::AccessorSetterCallback pPropPut) { v8::Isolate* isolate = (v8::Isolate*)pJSRuntime; v8::Isolate::Scope isolate_scope(isolate); - HandleScope handle_scope(isolate); + v8::HandleScope handle_scope(isolate); CFX_WideString ws = CFX_WideString((FX_LPCWSTR)sPropName); CFX_ByteString bsPropertyName = ws.UTF8Encode(); @@ -121,24 +121,24 @@ int JS_DefineObjProperty(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return 0; CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID); - v8::Local objTemp = v8::Local::New(isolate, pObjDef->m_objTemplate); + v8::Local objTemp = v8::Local::New(isolate, pObjDef->m_objTemplate); objTemp->SetAccessor(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsPropertyName)), pPropGet, pPropPut); pObjDef->m_objTemplate.Reset(isolate,objTemp); return 0; } -int JS_DefineObjAllProperties(IJS_Runtime* pJSRuntime, int nObjDefnID, NamedPropertyQueryCallback pPropQurey, NamedPropertyGetterCallback pPropGet, NamedPropertySetterCallback pPropPut, NamedPropertyDeleterCallback pPropDel) +int JS_DefineObjAllProperties(IJS_Runtime* pJSRuntime, int nObjDefnID, v8::NamedPropertyQueryCallback pPropQurey, v8::NamedPropertyGetterCallback pPropGet, v8::NamedPropertySetterCallback pPropPut, v8::NamedPropertyDeleterCallback pPropDel) { v8::Isolate* isolate = (v8::Isolate*)pJSRuntime; v8::Isolate::Scope isolate_scope(isolate); - HandleScope handle_scope(isolate); + v8::HandleScope handle_scope(isolate); CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0); if(!pArray) return 0; if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return 0; CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID); - v8::Local objTemp = v8::Local::New(isolate, pObjDef->m_objTemplate); + v8::Local objTemp = v8::Local::New(isolate, pObjDef->m_objTemplate); objTemp->SetNamedPropertyHandler(pPropGet, pPropPut, pPropQurey, pPropDel); pObjDef->m_objTemplate.Reset(isolate,objTemp); return 0; @@ -148,7 +148,7 @@ int JS_DefineObjConst(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sC { v8::Isolate* isolate = (v8::Isolate*)pJSRuntime; v8::Isolate::Scope isolate_scope(isolate); - HandleScope handle_scope(isolate); + v8::HandleScope handle_scope(isolate); CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0); if(!pArray) return 0; @@ -158,17 +158,17 @@ int JS_DefineObjConst(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sC if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return 0; CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID); - v8::Local objTemp = v8::Local::New(isolate, pObjDef->m_objTemplate); + v8::Local objTemp = v8::Local::New(isolate, pObjDef->m_objTemplate); objTemp->Set(isolate, FX_LPCSTR(bsConstName), pDefault); pObjDef->m_objTemplate.Reset(isolate,objTemp); return 0; } -static v8::Persistent& _getGlobalObjectTemplate(IJS_Runtime* pJSRuntime) +static v8::Persistent& _getGlobalObjectTemplate(IJS_Runtime* pJSRuntime) { v8::Isolate* isolate = (v8::Isolate*)pJSRuntime; v8::Isolate::Scope isolate_scope(isolate); - HandleScope handle_scope(isolate); + v8::HandleScope handle_scope(isolate); CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0); ASSERT(pArray != NULL); @@ -178,28 +178,28 @@ static v8::Persistent& _getGlobalObjectTemplate(IJS_Runtime* pJS if(pObjDef->m_bSetAsGlobalObject) return pObjDef->m_objTemplate; } - static v8::Persistent gloabalObjectTemplate; + static v8::Persistent gloabalObjectTemplate; return gloabalObjectTemplate; } -int JS_DefineGlobalMethod(IJS_Runtime* pJSRuntime, const wchar_t* sMethodName, FunctionCallback pMethodCall, unsigned nParamNum) +int JS_DefineGlobalMethod(IJS_Runtime* pJSRuntime, const wchar_t* sMethodName, v8::FunctionCallback pMethodCall, unsigned nParamNum) { v8::Isolate* isolate = (v8::Isolate*)pJSRuntime; v8::Isolate::Scope isolate_scope(isolate); - HandleScope handle_scope(isolate); + v8::HandleScope handle_scope(isolate); CFX_WideString ws = CFX_WideString((FX_LPCWSTR)sMethodName); CFX_ByteString bsMethodName = ws.UTF8Encode(); - v8::Local funTempl = FunctionTemplate::New(isolate, pMethodCall); - v8::Local objTemp; + v8::Local funTempl = v8::FunctionTemplate::New(isolate, pMethodCall); + v8::Local objTemp; - v8::Persistent& globalObjTemp = _getGlobalObjectTemplate(pJSRuntime); + v8::Persistent& globalObjTemp = _getGlobalObjectTemplate(pJSRuntime); if(globalObjTemp.IsEmpty()) - objTemp = ObjectTemplate::New(isolate); + objTemp = v8::ObjectTemplate::New(isolate); else - objTemp = v8::Local::New(isolate, globalObjTemp); - objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsMethodName)), funTempl, ReadOnly); + objTemp = v8::Local::New(isolate, globalObjTemp); + objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsMethodName)), funTempl, v8::ReadOnly); globalObjTemp.Reset(isolate,objTemp); @@ -210,19 +210,19 @@ int JS_DefineGlobalConst(IJS_Runtime* pJSRuntime, const wchar_t* sConstName, v8: { v8::Isolate* isolate = (v8::Isolate*)pJSRuntime; v8::Isolate::Scope isolate_scope(isolate); - HandleScope handle_scope(isolate); + v8::HandleScope handle_scope(isolate); CFX_WideString ws = CFX_WideString((FX_LPCWSTR)sConstName); CFX_ByteString bsConst= ws.UTF8Encode(); - v8::Local objTemp; + v8::Local objTemp; - v8::Persistent& globalObjTemp = _getGlobalObjectTemplate(pJSRuntime); + v8::Persistent& globalObjTemp = _getGlobalObjectTemplate(pJSRuntime); if(globalObjTemp.IsEmpty()) - objTemp = ObjectTemplate::New(isolate); + objTemp = v8::ObjectTemplate::New(isolate); else - objTemp = v8::Local::New(isolate, globalObjTemp); - objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsConst)), pDefault, ReadOnly); + objTemp = v8::Local::New(isolate, globalObjTemp); + objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsConst)), pDefault, v8::ReadOnly); globalObjTemp.Reset(isolate,objTemp); @@ -234,13 +234,13 @@ void JS_InitialRuntime(IJS_Runtime* pJSRuntime,IFXJS_Runtime* pFXRuntime, IFXJS_ { v8::Isolate* isolate = (v8::Isolate*)pJSRuntime; v8::Isolate::Scope isolate_scope(isolate); - HandleScope handle_scope(isolate); + v8::HandleScope handle_scope(isolate); - v8::Persistent& globalObjTemp = _getGlobalObjectTemplate(pJSRuntime); - v8::Handle v8Context = v8::Context::New(isolate, NULL, v8::Local::New(isolate, globalObjTemp)); + v8::Persistent& globalObjTemp = _getGlobalObjectTemplate(pJSRuntime); + v8::Handle v8Context = v8::Context::New(isolate, NULL, v8::Local::New(isolate, globalObjTemp)); v8::Context::Scope context_scope(v8Context); - v8::Handle ptr = External::New(isolate, pFXRuntime); + v8::Handle ptr = v8::External::New(isolate, pFXRuntime); v8Context->SetEmbedderData(1, ptr); CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(0); @@ -262,7 +262,7 @@ void JS_InitialRuntime(IJS_Runtime* pJSRuntime,IFXJS_Runtime* pFXRuntime, IFXJS_ CJS_PrivateData* pPrivateData = FX_NEW CJS_PrivateData; pPrivateData->ObjDefID = i; - v8::Handle ptr = External::New(isolate, pPrivateData); + v8::Handle ptr = v8::External::New(isolate, pPrivateData); v8Context->Global()->GetPrototype()->ToObject()->SetInternalField(0, ptr); @@ -284,7 +284,7 @@ void JS_ReleaseRuntime(IJS_Runtime* pJSRuntime, v8::Persistent& v8P { v8::Isolate* isolate = (v8::Isolate*)pJSRuntime; v8::Isolate::Scope isolate_scope(isolate); - HandleScope handle_scope(isolate); + v8::HandleScope handle_scope(isolate); v8::Local context = v8::Local::New(isolate, v8PersistentContext); v8::Context::Scope context_scope(context); @@ -321,13 +321,13 @@ int JS_Parse(IJS_Runtime* pJSRuntime, IFXJS_Context* pJSContext, const wchar_t* { v8::Isolate* isolate = (v8::Isolate*)pJSRuntime; v8::Isolate::Scope isolate_scope(isolate); - TryCatch try_catch; + v8::TryCatch try_catch; CFX_WideString wsScript(script); CFX_ByteString bsScript = wsScript.UTF8Encode(); - v8::Handle