 Chromium Code Reviews
 Chromium Code Reviews Issue 1910253005:
  [api] Expose FunctionCallbackInfo::NewTarget  (Closed) 
  Base URL: https://chromium.googlesource.com/v8/v8.git@master
    
  
    Issue 1910253005:
  [api] Expose FunctionCallbackInfo::NewTarget  (Closed) 
  Base URL: https://chromium.googlesource.com/v8/v8.git@master| OLD | NEW | 
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project 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 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide | 
| 6 * | 6 * | 
| 7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. | 
| 8 * | 8 * | 
| 9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the | 
| 10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. | 
| (...skipping 3174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3185 */ | 3185 */ | 
| 3186 template<typename T> | 3186 template<typename T> | 
| 3187 class FunctionCallbackInfo { | 3187 class FunctionCallbackInfo { | 
| 3188 public: | 3188 public: | 
| 3189 V8_INLINE int Length() const; | 3189 V8_INLINE int Length() const; | 
| 3190 V8_INLINE Local<Value> operator[](int i) const; | 3190 V8_INLINE Local<Value> operator[](int i) const; | 
| 3191 V8_INLINE V8_DEPRECATED("Use Data() to explicitly pass Callee instead", | 3191 V8_INLINE V8_DEPRECATED("Use Data() to explicitly pass Callee instead", | 
| 3192 Local<Function> Callee() const); | 3192 Local<Function> Callee() const); | 
| 3193 V8_INLINE Local<Object> This() const; | 3193 V8_INLINE Local<Object> This() const; | 
| 3194 V8_INLINE Local<Object> Holder() const; | 3194 V8_INLINE Local<Object> Holder() const; | 
| 3195 V8_INLINE Local<Value> NewTarget() const; | |
| 3195 V8_INLINE bool IsConstructCall() const; | 3196 V8_INLINE bool IsConstructCall() const; | 
| 3196 V8_INLINE Local<Value> Data() const; | 3197 V8_INLINE Local<Value> Data() const; | 
| 3197 V8_INLINE Isolate* GetIsolate() const; | 3198 V8_INLINE Isolate* GetIsolate() const; | 
| 3198 V8_INLINE ReturnValue<T> GetReturnValue() const; | 3199 V8_INLINE ReturnValue<T> GetReturnValue() const; | 
| 3199 // This shouldn't be public, but the arm compiler needs it. | 3200 // This shouldn't be public, but the arm compiler needs it. | 
| 3200 static const int kArgsLength = 7; | 3201 static const int kArgsLength = 8; | 
| 3201 | 3202 | 
| 3202 protected: | 3203 protected: | 
| 3203 friend class internal::FunctionCallbackArguments; | 3204 friend class internal::FunctionCallbackArguments; | 
| 3204 friend class internal::CustomArguments<FunctionCallbackInfo>; | 3205 friend class internal::CustomArguments<FunctionCallbackInfo>; | 
| 3205 static const int kHolderIndex = 0; | 3206 static const int kHolderIndex = 0; | 
| 3206 static const int kIsolateIndex = 1; | 3207 static const int kIsolateIndex = 1; | 
| 
Benedikt Meurer
2016/04/23 11:45:41
It'd be nice to remove isolate and callee here (no
 
adamk
2016/04/25 22:59:55
Seems reasonable for a followup, indeed. My recoll
 | |
| 3207 static const int kReturnValueDefaultValueIndex = 2; | 3208 static const int kReturnValueDefaultValueIndex = 2; | 
| 3208 static const int kReturnValueIndex = 3; | 3209 static const int kReturnValueIndex = 3; | 
| 3209 static const int kDataIndex = 4; | 3210 static const int kDataIndex = 4; | 
| 3210 static const int kCalleeIndex = 5; | 3211 static const int kCalleeIndex = 5; | 
| 3211 static const int kContextSaveIndex = 6; | 3212 static const int kContextSaveIndex = 6; | 
| 3213 static const int kNewTargetIndex = 7; | |
| 3212 | 3214 | 
| 3213 V8_INLINE FunctionCallbackInfo(internal::Object** implicit_args, | 3215 V8_INLINE FunctionCallbackInfo(internal::Object** implicit_args, | 
| 3214 internal::Object** values, | 3216 internal::Object** values, | 
| 3215 int length, | 3217 int length, | 
| 3216 bool is_construct_call); | 3218 bool is_construct_call); | 
| 3217 internal::Object** implicit_args_; | 3219 internal::Object** implicit_args_; | 
| 3218 internal::Object** values_; | 3220 internal::Object** values_; | 
| 3219 int length_; | 3221 int length_; | 
| 3220 int is_construct_call_; | 3222 int is_construct_call_; | 
| 
Benedikt Meurer
2016/04/23 11:45:41
This can now be removed (and potentially everythin
 
adamk
2016/04/25 22:59:55
There's one problem with removing this, which is t
 
adamk
2016/04/25 23:35:48
Patch set 4 includes the changes to IsConstructCal
 
Benedikt Meurer
2016/04/26 04:15:34
You don't "set" new.target to something. You just
 | |
| 3221 }; | 3223 }; | 
| 3222 | 3224 | 
| 3223 | 3225 | 
| 3224 /** | 3226 /** | 
| 3225 * The information passed to a property callback about the context | 3227 * The information passed to a property callback about the context | 
| 3226 * of the property access. | 3228 * of the property access. | 
| 3227 */ | 3229 */ | 
| 3228 template<typename T> | 3230 template<typename T> | 
| 3229 class PropertyCallbackInfo { | 3231 class PropertyCallbackInfo { | 
| 3230 public: | 3232 public: | 
| (...skipping 4665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7896 return Local<Object>(reinterpret_cast<Object*>(values_ + 1)); | 7898 return Local<Object>(reinterpret_cast<Object*>(values_ + 1)); | 
| 7897 } | 7899 } | 
| 7898 | 7900 | 
| 7899 | 7901 | 
| 7900 template<typename T> | 7902 template<typename T> | 
| 7901 Local<Object> FunctionCallbackInfo<T>::Holder() const { | 7903 Local<Object> FunctionCallbackInfo<T>::Holder() const { | 
| 7902 return Local<Object>(reinterpret_cast<Object*>( | 7904 return Local<Object>(reinterpret_cast<Object*>( | 
| 7903 &implicit_args_[kHolderIndex])); | 7905 &implicit_args_[kHolderIndex])); | 
| 7904 } | 7906 } | 
| 7905 | 7907 | 
| 7908 template <typename T> | |
| 7909 Local<Value> FunctionCallbackInfo<T>::NewTarget() const { | |
| 7910 return Local<Value>( | |
| 7911 reinterpret_cast<Value*>(&implicit_args_[kNewTargetIndex])); | |
| 7912 } | |
| 7906 | 7913 | 
| 7907 template<typename T> | 7914 template <typename T> | 
| 7908 Local<Value> FunctionCallbackInfo<T>::Data() const { | 7915 Local<Value> FunctionCallbackInfo<T>::Data() const { | 
| 7909 return Local<Value>(reinterpret_cast<Value*>(&implicit_args_[kDataIndex])); | 7916 return Local<Value>(reinterpret_cast<Value*>(&implicit_args_[kDataIndex])); | 
| 7910 } | 7917 } | 
| 7911 | 7918 | 
| 7912 | 7919 | 
| 7913 template<typename T> | 7920 template<typename T> | 
| 7914 Isolate* FunctionCallbackInfo<T>::GetIsolate() const { | 7921 Isolate* FunctionCallbackInfo<T>::GetIsolate() const { | 
| 7915 return *reinterpret_cast<Isolate**>(&implicit_args_[kIsolateIndex]); | 7922 return *reinterpret_cast<Isolate**>(&implicit_args_[kIsolateIndex]); | 
| 7916 } | 7923 } | 
| 7917 | 7924 | 
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8771 */ | 8778 */ | 
| 8772 | 8779 | 
| 8773 | 8780 | 
| 8774 } // namespace v8 | 8781 } // namespace v8 | 
| 8775 | 8782 | 
| 8776 | 8783 | 
| 8777 #undef TYPE_CHECK | 8784 #undef TYPE_CHECK | 
| 8778 | 8785 | 
| 8779 | 8786 | 
| 8780 #endif // INCLUDE_V8_H_ | 8787 #endif // INCLUDE_V8_H_ | 
| OLD | NEW |