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

Side by Side Diff: include/v8.h

Issue 2263303003: [api] Add documentation for PropertyCallbackInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@DocSetHandler
Patch Set: Change documentation for GetReturnValue(). Created 4 years, 3 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 | « no previous file | 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 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
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
3251 /**
3252 * \return The receiver, i.e., the object on which the property access was
3253 * intercepted.
Toon Verwaest 2016/08/23 13:28:34 I guess the explanation is good enough, but we did
Franzi 2016/08/24 09:04:05 IMHO poor documentation is worse than no documenta
3254 */
3241 V8_INLINE Local<Object> This() const; 3255 V8_INLINE Local<Object> This() const;
3256
3257 /**
3258 * \return The object in the prototype chain of the receiver that has the
3259 * interceptor. Suppose you have `x` and its prototype is `y`, and `y`
3260 * has an interceptor. Then `info.This()` is `x` and `info.Holder()` is `y`.
Toon Verwaest 2016/08/23 13:28:34 Holder could be a hidden object (the global object
Franzi 2016/08/24 09:04:05 Added a comment about the hidden object and a warn
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 */
3243 V8_INLINE ReturnValue<T> GetReturnValue() const; 3271 V8_INLINE ReturnValue<T> GetReturnValue() const;
3272
3273 /**
3274 * \return True, if the intercepted function should
Toon Verwaest 2016/08/23 13:28:34 drop the , after True
Franzi 2016/08/24 09:04:05 Done.
3275 * throw if an error occurs. Usually, `true` corresponds to `'use strict.'`
Toon Verwaest 2016/08/23 13:28:34 It's false if Reflect.get and friends are used; th
Franzi 2016/08/24 09:04:05 Done.
3276 */
3244 V8_INLINE bool ShouldThrowOnError() const; 3277 V8_INLINE bool ShouldThrowOnError() const;
3278
3245 // This shouldn't be public, but the arm compiler needs it. 3279 // This shouldn't be public, but the arm compiler needs it.
3246 static const int kArgsLength = 7; 3280 static const int kArgsLength = 7;
3247 3281
3248 protected: 3282 protected:
3249 friend class MacroAssembler; 3283 friend class MacroAssembler;
3250 friend class internal::PropertyCallbackArguments; 3284 friend class internal::PropertyCallbackArguments;
3251 friend class internal::CustomArguments<PropertyCallbackInfo>; 3285 friend class internal::CustomArguments<PropertyCallbackInfo>;
3252 static const int kShouldThrowOnErrorIndex = 0; 3286 static const int kShouldThrowOnErrorIndex = 0;
3253 static const int kHolderIndex = 1; 3287 static const int kHolderIndex = 1;
3254 static const int kIsolateIndex = 2; 3288 static const int kIsolateIndex = 2;
(...skipping 5731 matching lines...) Expand 10 before | Expand all | Expand 10 after
8986 */ 9020 */
8987 9021
8988 9022
8989 } // namespace v8 9023 } // namespace v8
8990 9024
8991 9025
8992 #undef TYPE_CHECK 9026 #undef TYPE_CHECK
8993 9027
8994 9028
8995 #endif // INCLUDE_V8_H_ 9029 #endif // INCLUDE_V8_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698