| OLD | NEW |
| 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 "fxjse/include/cfxjse_arguments.h" | 7 #include "fxjse/include/cfxjse_arguments.h" |
| 8 #include "fxjse/include/cfxjse_class.h" | 8 #include "fxjse/include/cfxjse_class.h" |
| 9 #include "fxjse/include/cfxjse_value.h" | 9 #include "fxjse/include/cfxjse_value.h" |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 v8::ObjectTemplate::New(pIsolate); | 50 v8::ObjectTemplate::New(pIsolate); |
| 51 hCallBackInfoTemplate->SetInternalFieldCount(2); | 51 hCallBackInfoTemplate->SetInternalFieldCount(2); |
| 52 v8::Local<v8::Object> hCallBackInfo = | 52 v8::Local<v8::Object> hCallBackInfo = |
| 53 hCallBackInfoTemplate->NewInstance(); | 53 hCallBackInfoTemplate->NewInstance(); |
| 54 hCallBackInfo->SetAlignedPointerInInternalField( | 54 hCallBackInfo->SetAlignedPointerInInternalField( |
| 55 0, const_cast<FXJSE_CLASS_DESCRIPTOR*>(lpClass)); | 55 0, const_cast<FXJSE_CLASS_DESCRIPTOR*>(lpClass)); |
| 56 hCallBackInfo->SetInternalField( | 56 hCallBackInfo->SetInternalField( |
| 57 1, v8::String::NewFromUtf8( | 57 1, v8::String::NewFromUtf8( |
| 58 pIsolate, reinterpret_cast<const char*>(szPropName.raw_str()), | 58 pIsolate, reinterpret_cast<const char*>(szPropName.raw_str()), |
| 59 v8::String::kNormalString, szPropName.GetLength())); | 59 v8::String::kNormalString, szPropName.GetLength())); |
| 60 pValue->ForceSetValue(v8::Function::New( | 60 pValue->ForceSetValue( |
| 61 pValue->GetIsolate(), FXJSE_DynPropGetterAdapter_MethodCallback, | 61 v8::Function::New(pValue->GetIsolate()->GetCurrentContext(), |
| 62 hCallBackInfo)); | 62 FXJSE_DynPropGetterAdapter_MethodCallback, |
| 63 hCallBackInfo, 0, v8::ConstructorBehavior::kThrow) |
| 64 .ToLocalChecked()); |
| 63 } | 65 } |
| 64 } | 66 } |
| 65 } | 67 } |
| 66 | 68 |
| 67 static void FXJSE_DynPropSetterAdapter(const FXJSE_CLASS_DESCRIPTOR* lpClass, | 69 static void FXJSE_DynPropSetterAdapter(const FXJSE_CLASS_DESCRIPTOR* lpClass, |
| 68 CFXJSE_Value* pObject, | 70 CFXJSE_Value* pObject, |
| 69 const CFX_ByteStringC& szPropName, | 71 const CFX_ByteStringC& szPropName, |
| 70 CFXJSE_Value* pValue) { | 72 CFXJSE_Value* pValue) { |
| 71 ASSERT(lpClass); | 73 ASSERT(lpClass); |
| 72 int32_t nPropType = | 74 int32_t nPropType = |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 : 0, | 216 : 0, |
| 215 lpClassDefinition->dynPropDeleter | 217 lpClassDefinition->dynPropDeleter |
| 216 ? FXJSE_V8_GenericNamedPropertyDeleterCallback | 218 ? FXJSE_V8_GenericNamedPropertyDeleterCallback |
| 217 : 0, | 219 : 0, |
| 218 FXJSE_V8_GenericNamedPropertyEnumeratorCallback, | 220 FXJSE_V8_GenericNamedPropertyEnumeratorCallback, |
| 219 v8::External::New(pIsolate, | 221 v8::External::New(pIsolate, |
| 220 const_cast<FXJSE_CLASS_DESCRIPTOR*>(lpClassDefinition)), | 222 const_cast<FXJSE_CLASS_DESCRIPTOR*>(lpClassDefinition)), |
| 221 v8::PropertyHandlerFlags::kNonMasking); | 223 v8::PropertyHandlerFlags::kNonMasking); |
| 222 hObjectTemplate->SetHandler(configuration); | 224 hObjectTemplate->SetHandler(configuration); |
| 223 } | 225 } |
| OLD | NEW |