aboutsummaryrefslogtreecommitdiff
path: root/fxjs/cjs_globalconsts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs/cjs_globalconsts.cpp')
-rw-r--r--fxjs/cjs_globalconsts.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/fxjs/cjs_globalconsts.cpp b/fxjs/cjs_globalconsts.cpp
index cb6bd33c4..854ded817 100644
--- a/fxjs/cjs_globalconsts.cpp
+++ b/fxjs/cjs_globalconsts.cpp
@@ -1,4 +1,4 @@
-// Copyright 2017 PDFium Authors. All rights reserved.
+// Copyright 2017 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,14 +6,13 @@
#include "fxjs/cjs_globalconsts.h"
-#define GLOBAL_STRING(rt, name, value) \
- (rt)->DefineGlobalConst( \
- (name), [](const v8::FunctionCallbackInfo<v8::Value>& info) { \
- const char* pStr = (value); \
- info.GetReturnValue().Set( \
- v8::String::NewFromUtf8(info.GetIsolate(), pStr, \
- v8::NewStringType::kNormal, strlen(pStr)) \
- .ToLocalChecked()); \
+#include "fxjs/fxv8.h"
+
+#define GLOBAL_STRING(rt, name, value) \
+ (rt)->DefineGlobalConst( \
+ (name), [](const v8::FunctionCallbackInfo<v8::Value>& info) { \
+ info.GetReturnValue().Set( \
+ fxv8::NewStringHelper(info.GetIsolate(), (value))); \
})
// static