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

Side by Side Diff: include/v8.h

Issue 977893002: convert remaining object functions to maybes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 | src/api.cc » ('j') | 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 2621 matching lines...) Expand 10 before | Expand all | Expand 10 after
2632 * Finds an instance of the given function template in the prototype 2632 * Finds an instance of the given function template in the prototype
2633 * chain. 2633 * chain.
2634 */ 2634 */
2635 Local<Object> FindInstanceInPrototypeChain(Handle<FunctionTemplate> tmpl); 2635 Local<Object> FindInstanceInPrototypeChain(Handle<FunctionTemplate> tmpl);
2636 2636
2637 /** 2637 /**
2638 * Call builtin Object.prototype.toString on this object. 2638 * Call builtin Object.prototype.toString on this object.
2639 * This is different from Value::ToString() that may call 2639 * This is different from Value::ToString() that may call
2640 * user-defined toString function. This one does not. 2640 * user-defined toString function. This one does not.
2641 */ 2641 */
2642 // TODO(dcarney): convert this - needs recursion currently. 2642 // TODO(dcarney): deprecate
2643 Local<String> ObjectProtoToString(); 2643 Local<String> ObjectProtoToString();
2644 MaybeLocal<String> ObjectProtoToString(Local<Context> context);
2644 2645
2645 /** 2646 /**
2646 * Returns the name of the function invoked as a constructor for this object. 2647 * Returns the name of the function invoked as a constructor for this object.
2647 */ 2648 */
2648 Local<String> GetConstructorName(); 2649 Local<String> GetConstructorName();
2649 2650
2650 /** Gets the number of internal fields for this Object. */ 2651 /** Gets the number of internal fields for this Object. */
2651 int InternalFieldCount(); 2652 int InternalFieldCount();
2652 2653
2653 /** Same as above, but works for Persistents */ 2654 /** Same as above, but works for Persistents */
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
2759 * unique. 2760 * unique.
2760 */ 2761 */
2761 int GetIdentityHash(); 2762 int GetIdentityHash();
2762 2763
2763 /** 2764 /**
2764 * Access hidden properties on JavaScript objects. These properties are 2765 * Access hidden properties on JavaScript objects. These properties are
2765 * hidden from the executing JavaScript and only accessible through the V8 2766 * hidden from the executing JavaScript and only accessible through the V8
2766 * C++ API. Hidden properties introduced by V8 internally (for example the 2767 * C++ API. Hidden properties introduced by V8 internally (for example the
2767 * identity hash) are prefixed with "v8::". 2768 * identity hash) are prefixed with "v8::".
2768 */ 2769 */
2769 // TODO(dcarney): convert these? 2770 // TODO(dcarney): convert these to take a isolate and optionally bailout?
2770 bool SetHiddenValue(Handle<String> key, Handle<Value> value); 2771 bool SetHiddenValue(Handle<String> key, Handle<Value> value);
2771 Local<Value> GetHiddenValue(Handle<String> key); 2772 Local<Value> GetHiddenValue(Handle<String> key);
2772 bool DeleteHiddenValue(Handle<String> key); 2773 bool DeleteHiddenValue(Handle<String> key);
2773 2774
2774 /** 2775 /**
2775 * Clone this object with a fast but shallow copy. Values will point 2776 * Clone this object with a fast but shallow copy. Values will point
2776 * to the same values as the original object. 2777 * to the same values as the original object.
2777 */ 2778 */
2778 // TODO(dcarney): convert this? 2779 // TODO(dcarney): take an isolate and optionally bail out?
2779 Local<Object> Clone(); 2780 Local<Object> Clone();
2780 2781
2781 /** 2782 /**
2782 * Returns the context in which the object was created. 2783 * Returns the context in which the object was created.
2783 */ 2784 */
2784 Local<Context> CreationContext(); 2785 Local<Context> CreationContext();
2785 2786
2786 /** 2787 /**
2787 * Set the backing store of the indexed properties to be managed by the 2788 * Set the backing store of the indexed properties to be managed by the
2788 * embedding layer. Access to the indexed properties will follow the rules 2789 * embedding layer. Access to the indexed properties will follow the rules
(...skipping 28 matching lines...) Expand all
2817 */ 2818 */
2818 bool IsCallable(); 2819 bool IsCallable();
2819 2820
2820 /** 2821 /**
2821 * Call an Object as a function if a callback is set by the 2822 * Call an Object as a function if a callback is set by the
2822 * ObjectTemplate::SetCallAsFunctionHandler method. 2823 * ObjectTemplate::SetCallAsFunctionHandler method.
2823 */ 2824 */
2824 Local<Value> CallAsFunction(Handle<Value> recv, 2825 Local<Value> CallAsFunction(Handle<Value> recv,
2825 int argc, 2826 int argc,
2826 Handle<Value> argv[]); 2827 Handle<Value> argv[]);
2828 MaybeLocal<Value> CallAsFunction(Local<Context> context, Handle<Value> recv,
2829 int argc, Handle<Value> argv[]);
2827 2830
2828 /** 2831 /**
2829 * Call an Object as a constructor if a callback is set by the 2832 * Call an Object as a constructor if a callback is set by the
2830 * ObjectTemplate::SetCallAsFunctionHandler method. 2833 * ObjectTemplate::SetCallAsFunctionHandler method.
2831 * Note: This method behaves like the Function::NewInstance method. 2834 * Note: This method behaves like the Function::NewInstance method.
2832 */ 2835 */
2833 Local<Value> CallAsConstructor(int argc, Handle<Value> argv[]); 2836 Local<Value> CallAsConstructor(int argc, Handle<Value> argv[]);
2837 MaybeLocal<Value> CallAsConstructor(Local<Context> context, int argc,
2838 Local<Value> argv[]);
2834 2839
2835 /** 2840 /**
2836 * Return the isolate to which the Object belongs to. 2841 * Return the isolate to which the Object belongs to.
2837 */ 2842 */
2843 // TODO(dcarney): deprecate - this is an implementation detail.
2838 Isolate* GetIsolate(); 2844 Isolate* GetIsolate();
2839 2845
2840 static Local<Object> New(Isolate* isolate); 2846 static Local<Object> New(Isolate* isolate);
2841 2847
2842 V8_INLINE static Object* Cast(Value* obj); 2848 V8_INLINE static Object* Cast(Value* obj);
2843 2849
2844 private: 2850 private:
2845 Object(); 2851 Object();
2846 static void CheckCast(Value* obj); 2852 static void CheckCast(Value* obj);
2847 Local<Value> SlowGetInternalField(int index); 2853 Local<Value> SlowGetInternalField(int index);
(...skipping 4868 matching lines...) Expand 10 before | Expand all | Expand 10 after
7716 */ 7722 */
7717 7723
7718 7724
7719 } // namespace v8 7725 } // namespace v8
7720 7726
7721 7727
7722 #undef TYPE_CHECK 7728 #undef TYPE_CHECK
7723 7729
7724 7730
7725 #endif // V8_H_ 7731 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698