Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(783)

Side by Side Diff: xfa/fxjse/dynprop.cpp

Issue 2153113002: Remove constructor from functions that aren't constructors (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@2743
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build_gyp/standalone.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fxjse/cfxjse_arguments.h" 7 #include "xfa/fxjse/cfxjse_arguments.h"
8 #include "xfa/fxjse/class.h" 8 #include "xfa/fxjse/class.h"
9 #include "xfa/fxjse/value.h" 9 #include "xfa/fxjse/value.h"
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 v8::ObjectTemplate::New(pIsolate); 56 v8::ObjectTemplate::New(pIsolate);
57 hCallBackInfoTemplate->SetInternalFieldCount(2); 57 hCallBackInfoTemplate->SetInternalFieldCount(2);
58 v8::Local<v8::Object> hCallBackInfo = 58 v8::Local<v8::Object> hCallBackInfo =
59 hCallBackInfoTemplate->NewInstance(); 59 hCallBackInfoTemplate->NewInstance();
60 hCallBackInfo->SetAlignedPointerInInternalField( 60 hCallBackInfo->SetAlignedPointerInInternalField(
61 0, const_cast<FXJSE_CLASS*>(lpClass)); 61 0, const_cast<FXJSE_CLASS*>(lpClass));
62 hCallBackInfo->SetInternalField( 62 hCallBackInfo->SetInternalField(
63 1, v8::String::NewFromUtf8( 63 1, v8::String::NewFromUtf8(
64 pIsolate, reinterpret_cast<const char*>(szPropName.raw_str()), 64 pIsolate, reinterpret_cast<const char*>(szPropName.raw_str()),
65 v8::String::kNormalString, szPropName.GetLength())); 65 v8::String::kNormalString, szPropName.GetLength()));
66 lpValue->ForceSetValue(v8::Function::New( 66 lpValue->ForceSetValue(
67 lpValue->GetIsolate(), FXJSE_DynPropGetterAdapter_MethodCallback, 67 v8::Function::New(lpValue->GetIsolate()->GetCurrentContext(),
68 hCallBackInfo)); 68 FXJSE_DynPropGetterAdapter_MethodCallback,
69 hCallBackInfo, 0, v8::ConstructorBehavior::kThrow)
70 .ToLocalChecked());
69 } 71 }
70 } 72 }
71 } 73 }
72 74
73 static void FXJSE_DynPropSetterAdapter(const FXJSE_CLASS* lpClass, 75 static void FXJSE_DynPropSetterAdapter(const FXJSE_CLASS* lpClass,
74 FXJSE_HOBJECT hObject, 76 FXJSE_HOBJECT hObject,
75 const CFX_ByteStringC& szPropName, 77 const CFX_ByteStringC& szPropName,
76 FXJSE_HVALUE hValue) { 78 FXJSE_HVALUE hValue) {
77 ASSERT(lpClass); 79 ASSERT(lpClass);
78 int32_t nPropType = 80 int32_t nPropType =
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 ? FXJSE_V8_GenericNamedPropertyQueryCallback 230 ? FXJSE_V8_GenericNamedPropertyQueryCallback
229 : 0, 231 : 0,
230 lpClassDefinition->dynPropDeleter 232 lpClassDefinition->dynPropDeleter
231 ? FXJSE_V8_GenericNamedPropertyDeleterCallback 233 ? FXJSE_V8_GenericNamedPropertyDeleterCallback
232 : 0, 234 : 0,
233 FXJSE_V8_GenericNamedPropertyEnumeratorCallback, 235 FXJSE_V8_GenericNamedPropertyEnumeratorCallback,
234 v8::External::New(pIsolate, const_cast<FXJSE_CLASS*>(lpClassDefinition)), 236 v8::External::New(pIsolate, const_cast<FXJSE_CLASS*>(lpClassDefinition)),
235 v8::PropertyHandlerFlags::kNonMasking); 237 v8::PropertyHandlerFlags::kNonMasking);
236 hObjectTemplate->SetHandler(configuration); 238 hObjectTemplate->SetHandler(configuration);
237 } 239 }
OLDNEW
« no previous file with comments | « build_gyp/standalone.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698