summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/jsapi/fxjs_v8.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-03-04 12:33:33 -0800
committerTom Sepez <tsepez@chromium.org>2016-03-04 12:33:33 -0800
commit1a35d55dd6b0d1ea1918e2d6a6c25faf599ba168 (patch)
tree9511760e78804772d1035613abfeff71abe61870 /fpdfsdk/src/jsapi/fxjs_v8.cpp
parent3e44a7bd2b60ace1ee8bc8f48c709056f65c3dc1 (diff)
downloadpdfium-1a35d55dd6b0d1ea1918e2d6a6c25faf599ba168.tar.xz
Revert "Only place primitive objects on the V8 global template."
This reverts commit 3e44a7bd2b60ace1ee8bc8f48c709056f65c3dc1. R=ochang@chromium.org TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1767793002 .
Diffstat (limited to 'fpdfsdk/src/jsapi/fxjs_v8.cpp')
-rw-r--r--fpdfsdk/src/jsapi/fxjs_v8.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp
index 5631ab6258..f015f87136 100644
--- a/fpdfsdk/src/jsapi/fxjs_v8.cpp
+++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp
@@ -287,15 +287,14 @@ void FXJS_DefineGlobalMethod(v8::Isolate* pIsolate,
void FXJS_DefineGlobalConst(v8::Isolate* pIsolate,
const wchar_t* sConstName,
- v8::FunctionCallback pConstGetter) {
+ v8::Local<v8::Value> pDefault) {
v8::Isolate::Scope isolate_scope(pIsolate);
v8::HandleScope handle_scope(pIsolate);
CFX_ByteString bsConst = CFX_WideString(sConstName).UTF8Encode();
- GetGlobalObjectTemplate(pIsolate)
- ->SetAccessorProperty(v8::String::NewFromUtf8(pIsolate, bsConst.c_str(),
- v8::NewStringType::kNormal)
- .ToLocalChecked(),
- v8::FunctionTemplate::New(pIsolate, pConstGetter));
+ GetGlobalObjectTemplate(pIsolate)->Set(
+ v8::String::NewFromUtf8(pIsolate, bsConst.c_str(),
+ v8::NewStringType::kNormal).ToLocalChecked(),
+ pDefault, v8::ReadOnly);
}
void FXJS_InitializeRuntime(