summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/jsapi
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/jsapi')
-rw-r--r--fpdfsdk/src/jsapi/fxjs_v8.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp
index c03c84b7a7..3ab27e2d4a 100644
--- a/fpdfsdk/src/jsapi/fxjs_v8.cpp
+++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp
@@ -33,7 +33,7 @@ class CJS_PrivateData
public:
CJS_PrivateData():ObjDefID(-1), pPrivate(NULL) {}
int ObjDefID;
- FX_LPVOID pPrivate;
+ void* pPrivate;
};
@@ -105,7 +105,7 @@ 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<v8::ObjectTemplate> objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, pObjDef->m_objTemplate);
- objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsMethodName), v8::NewStringType::kNormal).ToLocalChecked(), v8::FunctionTemplate::New(isolate, pMethodCall), v8::ReadOnly);
+ objTemp->Set(v8::String::NewFromUtf8(isolate, bsMethodName.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), v8::FunctionTemplate::New(isolate, pMethodCall), v8::ReadOnly);
pObjDef->m_objTemplate.Reset(isolate,objTemp);
return 0;
}
@@ -125,7 +125,7 @@ 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<v8::ObjectTemplate> objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, pObjDef->m_objTemplate);
- objTemp->SetAccessor(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsPropertyName), v8::NewStringType::kNormal).ToLocalChecked(), pPropGet, pPropPut);
+ objTemp->SetAccessor(v8::String::NewFromUtf8(isolate, bsPropertyName.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), pPropGet, pPropPut);
pObjDef->m_objTemplate.Reset(isolate,objTemp);
return 0;
}
@@ -162,7 +162,7 @@ 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<v8::ObjectTemplate> objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, pObjDef->m_objTemplate);
- objTemp->Set(isolate, FX_LPCSTR(bsConstName), pDefault);
+ objTemp->Set(isolate, bsConstName.c_str(), pDefault);
pObjDef->m_objTemplate.Reset(isolate,objTemp);
return 0;
}
@@ -202,7 +202,7 @@ int JS_DefineGlobalMethod(IJS_Runtime* pJSRuntime, const wchar_t* sMethodName, v
objTemp = v8::ObjectTemplate::New(isolate);
else
objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, globalObjTemp);
- objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsMethodName), v8::NewStringType::kNormal).ToLocalChecked(), funTempl, v8::ReadOnly);
+ objTemp->Set(v8::String::NewFromUtf8(isolate, bsMethodName.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), funTempl, v8::ReadOnly);
globalObjTemp.Reset(isolate,objTemp);
@@ -225,7 +225,7 @@ int JS_DefineGlobalConst(IJS_Runtime* pJSRuntime, const wchar_t* sConstName, v8:
objTemp = v8::ObjectTemplate::New(isolate);
else
objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, globalObjTemp);
- objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsConst), v8::NewStringType::kNormal).ToLocalChecked(), pDefault, v8::ReadOnly);
+ objTemp->Set(v8::String::NewFromUtf8(isolate, bsConst.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), pDefault, v8::ReadOnly);
globalObjTemp.Reset(isolate,objTemp);
@@ -473,12 +473,12 @@ void JS_Error(v8::Isolate* isolate, const CFX_WideString& message)
unsigned JS_CalcHash(const wchar_t* main, unsigned nLen)
{
- return (unsigned)FX_HashCode_String_GetW((FX_LPCWSTR)main, nLen);
+ return (unsigned)FX_HashCode_String_GetW((const FX_WCHAR*)main, nLen);
}
unsigned JS_CalcHash(const wchar_t* main)
{
- return (unsigned)FX_HashCode_String_GetW((FX_LPCWSTR)main, FXSYS_wcslen(main));
+ return (unsigned)FX_HashCode_String_GetW((const FX_WCHAR*)main, FXSYS_wcslen(main));
}
const wchar_t* JS_GetTypeof(v8::Local<v8::Value> pObj)
{