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

Side by Side Diff: include/v8.h

Issue 993223003: convert most remaining api functions needing context 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 | include/v8-debug.h » ('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 2908 matching lines...) Expand 10 before | Expand all | Expand 10 after
2919 * An instance of the built-in array constructor (ECMA-262, 15.4.2). 2919 * An instance of the built-in array constructor (ECMA-262, 15.4.2).
2920 */ 2920 */
2921 class V8_EXPORT Array : public Object { 2921 class V8_EXPORT Array : public Object {
2922 public: 2922 public:
2923 uint32_t Length() const; 2923 uint32_t Length() const;
2924 2924
2925 /** 2925 /**
2926 * Clones an element at index |index|. Returns an empty 2926 * Clones an element at index |index|. Returns an empty
2927 * handle if cloning fails (for any reason). 2927 * handle if cloning fails (for any reason).
2928 */ 2928 */
2929 Local<Object> CloneElementAt(uint32_t index); 2929 V8_DEPRECATE_SOON("Use maybe version",
2930 Local<Object> CloneElementAt(uint32_t index));
2931 MaybeLocal<Object> CloneElementAt(Local<Context> context, uint32_t index);
2930 2932
2931 /** 2933 /**
2932 * Creates a JavaScript array with the given length. If the length 2934 * Creates a JavaScript array with the given length. If the length
2933 * is negative the returned array will have length 0. 2935 * is negative the returned array will have length 0.
2934 */ 2936 */
2935 static Local<Array> New(Isolate* isolate, int length = 0); 2937 static Local<Array> New(Isolate* isolate, int length = 0);
2936 2938
2937 V8_INLINE static Array* Cast(Value* obj); 2939 V8_INLINE static Array* Cast(Value* obj);
2938 private: 2940 private:
2939 Array(); 2941 Array();
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
3675 /** 3677 /**
3676 * Creates a regular expression from the given pattern string and 3678 * Creates a regular expression from the given pattern string and
3677 * the flags bit field. May throw a JavaScript exception as 3679 * the flags bit field. May throw a JavaScript exception as
3678 * described in ECMA-262, 15.10.4.1. 3680 * described in ECMA-262, 15.10.4.1.
3679 * 3681 *
3680 * For example, 3682 * For example,
3681 * RegExp::New(v8::String::New("foo"), 3683 * RegExp::New(v8::String::New("foo"),
3682 * static_cast<RegExp::Flags>(kGlobal | kMultiline)) 3684 * static_cast<RegExp::Flags>(kGlobal | kMultiline))
3683 * is equivalent to evaluating "/foo/gm". 3685 * is equivalent to evaluating "/foo/gm".
3684 */ 3686 */
3685 static Local<RegExp> New(Handle<String> pattern, Flags flags); 3687 static V8_DEPRECATE_SOON("Use maybe version",
3688 Local<RegExp> New(Handle<String> pattern,
3689 Flags flags));
3690 static MaybeLocal<RegExp> New(Local<Context> context, Handle<String> pattern,
3691 Flags flags);
3686 3692
3687 /** 3693 /**
3688 * Returns the value of the source property: a string representing 3694 * Returns the value of the source property: a string representing
3689 * the regular expression. 3695 * the regular expression.
3690 */ 3696 */
3691 Local<String> GetSource() const; 3697 Local<String> GetSource() const;
3692 3698
3693 /** 3699 /**
3694 * Returns the flags bit field. 3700 * Returns the flags bit field.
3695 */ 3701 */
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
4059 public: 4065 public:
4060 /** Creates a function template.*/ 4066 /** Creates a function template.*/
4061 static Local<FunctionTemplate> New( 4067 static Local<FunctionTemplate> New(
4062 Isolate* isolate, 4068 Isolate* isolate,
4063 FunctionCallback callback = 0, 4069 FunctionCallback callback = 0,
4064 Handle<Value> data = Handle<Value>(), 4070 Handle<Value> data = Handle<Value>(),
4065 Handle<Signature> signature = Handle<Signature>(), 4071 Handle<Signature> signature = Handle<Signature>(),
4066 int length = 0); 4072 int length = 0);
4067 4073
4068 /** Returns the unique function instance in the current execution context.*/ 4074 /** Returns the unique function instance in the current execution context.*/
4069 Local<Function> GetFunction(); 4075 V8_DEPRECATE_SOON("Use maybe version", Local<Function> GetFunction());
4076 MaybeLocal<Function> GetFunction(Local<Context> context);
4070 4077
4071 /** 4078 /**
4072 * Set the call-handler callback for a FunctionTemplate. This 4079 * Set the call-handler callback for a FunctionTemplate. This
4073 * callback is called whenever the function created from this 4080 * callback is called whenever the function created from this
4074 * FunctionTemplate is called. 4081 * FunctionTemplate is called.
4075 */ 4082 */
4076 void SetCallHandler(FunctionCallback callback, 4083 void SetCallHandler(FunctionCallback callback,
4077 Handle<Value> data = Handle<Value>()); 4084 Handle<Value> data = Handle<Value>());
4078 4085
4079 /** Set the predefined length property for the FunctionTemplate. */ 4086 /** Set the predefined length property for the FunctionTemplate. */
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
4202 * Properties added to an ObjectTemplate are added to each object 4209 * Properties added to an ObjectTemplate are added to each object
4203 * created from the ObjectTemplate. 4210 * created from the ObjectTemplate.
4204 */ 4211 */
4205 class V8_EXPORT ObjectTemplate : public Template { 4212 class V8_EXPORT ObjectTemplate : public Template {
4206 public: 4213 public:
4207 /** Creates an ObjectTemplate. */ 4214 /** Creates an ObjectTemplate. */
4208 static Local<ObjectTemplate> New(Isolate* isolate); 4215 static Local<ObjectTemplate> New(Isolate* isolate);
4209 static V8_DEPRECATE_SOON("Use isolate version", Local<ObjectTemplate> New()); 4216 static V8_DEPRECATE_SOON("Use isolate version", Local<ObjectTemplate> New());
4210 4217
4211 /** Creates a new instance of this template.*/ 4218 /** Creates a new instance of this template.*/
4212 Local<Object> NewInstance(); 4219 V8_DEPRECATE_SOON("Use maybe version", Local<Object> NewInstance());
4220 MaybeLocal<Object> NewInstance(Local<Context> context);
4213 4221
4214 /** 4222 /**
4215 * Sets an accessor on the object template. 4223 * Sets an accessor on the object template.
4216 * 4224 *
4217 * Whenever the property with the given name is accessed on objects 4225 * Whenever the property with the given name is accessed on objects
4218 * created from this ObjectTemplate the getter and setter callbacks 4226 * created from this ObjectTemplate the getter and setter callbacks
4219 * are called instead of getting and setting the property directly 4227 * are called instead of getting and setting the property directly
4220 * on the JavaScript object. 4228 * on the JavaScript object.
4221 * 4229 *
4222 * \param name The name of the property for which an accessor is added. 4230 * \param name The name of the property for which an accessor is added.
(...skipping 3616 matching lines...) Expand 10 before | Expand all | Expand 10 after
7839 */ 7847 */
7840 7848
7841 7849
7842 } // namespace v8 7850 } // namespace v8
7843 7851
7844 7852
7845 #undef TYPE_CHECK 7853 #undef TYPE_CHECK
7846 7854
7847 7855
7848 #endif // V8_H_ 7856 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | include/v8-debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698