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 3218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3229 }; | 3229 }; |
3230 | 3230 |
3231 | 3231 |
3232 /** | 3232 /** |
3233 * The information passed to a property callback about the context | 3233 * The information passed to a property callback about the context |
3234 * of the property access. | 3234 * of the property access. |
3235 */ | 3235 */ |
3236 template<typename T> | 3236 template<typename T> |
3237 class PropertyCallbackInfo { | 3237 class PropertyCallbackInfo { |
3238 public: | 3238 public: |
| 3239 /** |
| 3240 * \return The isolate of the property access. |
| 3241 */ |
3239 V8_INLINE Isolate* GetIsolate() const; | 3242 V8_INLINE Isolate* GetIsolate() const; |
| 3243 |
| 3244 /** |
| 3245 * \return The data set in the configuration, i.e., in |
| 3246 * `NamedPropertyHandlerConfiguration` or |
| 3247 * `IndexedPropertyHandlerConfiguration.` |
| 3248 */ |
3240 V8_INLINE Local<Value> Data() const; | 3249 V8_INLINE Local<Value> Data() const; |
| 3250 |
3241 V8_INLINE Local<Object> This() const; | 3251 V8_INLINE Local<Object> This() const; |
| 3252 |
| 3253 /** |
| 3254 * \return The object in the prototype chain of the receiver that has the |
| 3255 * interceptor. Suppose you have `x` and its prototype is `y`, and `y` |
| 3256 * has an interceptor. Then `info.This()` is `x` and `info.Holder()` is `y`. |
| 3257 * The Holder() could be a hidden object (the global object, rather |
| 3258 * than the global proxy). |
| 3259 * |
| 3260 * \note For security reasons, do not pass the object back into the runtime. |
| 3261 */ |
3242 V8_INLINE Local<Object> Holder() const; | 3262 V8_INLINE Local<Object> Holder() const; |
| 3263 |
| 3264 /** |
| 3265 * \return The return value of the callback. |
| 3266 * Can be changed by calling Set(). |
| 3267 * \code |
| 3268 * info.GetReturnValue().Set(...) |
| 3269 * \endcode |
| 3270 * |
| 3271 */ |
3243 V8_INLINE ReturnValue<T> GetReturnValue() const; | 3272 V8_INLINE ReturnValue<T> GetReturnValue() const; |
| 3273 |
| 3274 /** |
| 3275 * \return True if the intercepted function should throw if an error occurs. |
| 3276 * Usually, `true` corresponds to `'use strict'`. |
| 3277 * |
| 3278 * \note Always `false` when intercepting `Reflect.Set()` |
| 3279 * independent of the language mode. |
| 3280 */ |
3244 V8_INLINE bool ShouldThrowOnError() const; | 3281 V8_INLINE bool ShouldThrowOnError() const; |
| 3282 |
3245 // This shouldn't be public, but the arm compiler needs it. | 3283 // This shouldn't be public, but the arm compiler needs it. |
3246 static const int kArgsLength = 7; | 3284 static const int kArgsLength = 7; |
3247 | 3285 |
3248 protected: | 3286 protected: |
3249 friend class MacroAssembler; | 3287 friend class MacroAssembler; |
3250 friend class internal::PropertyCallbackArguments; | 3288 friend class internal::PropertyCallbackArguments; |
3251 friend class internal::CustomArguments<PropertyCallbackInfo>; | 3289 friend class internal::CustomArguments<PropertyCallbackInfo>; |
3252 static const int kShouldThrowOnErrorIndex = 0; | 3290 static const int kShouldThrowOnErrorIndex = 0; |
3253 static const int kHolderIndex = 1; | 3291 static const int kHolderIndex = 1; |
3254 static const int kIsolateIndex = 2; | 3292 static const int kIsolateIndex = 2; |
(...skipping 5731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8986 */ | 9024 */ |
8987 | 9025 |
8988 | 9026 |
8989 } // namespace v8 | 9027 } // namespace v8 |
8990 | 9028 |
8991 | 9029 |
8992 #undef TYPE_CHECK | 9030 #undef TYPE_CHECK |
8993 | 9031 |
8994 | 9032 |
8995 #endif // INCLUDE_V8_H_ | 9033 #endif // INCLUDE_V8_H_ |
OLD | NEW |