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

Side by Side Diff: include/v8.h

Issue 78873008: Turn on deprecation for standalone builds and clean up use of deprecated APIs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « build/standalone.gypi ('k') | samples/lineprocessor.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after
1728 const ExternalAsciiStringResource* GetExternalAsciiStringResource() const; 1728 const ExternalAsciiStringResource* GetExternalAsciiStringResource() const;
1729 1729
1730 V8_INLINE static String* Cast(v8::Value* obj); 1730 V8_INLINE static String* Cast(v8::Value* obj);
1731 1731
1732 /** 1732 /**
1733 * Allocates a new string from either UTF-8 encoded or ASCII data. 1733 * Allocates a new string from either UTF-8 encoded or ASCII data.
1734 * The second parameter 'length' gives the buffer length. If omitted, 1734 * The second parameter 'length' gives the buffer length. If omitted,
1735 * the function calls 'strlen' to determine the buffer length. 1735 * the function calls 'strlen' to determine the buffer length.
1736 */ 1736 */
1737 V8_DEPRECATED( 1737 V8_DEPRECATED(
1738 "Use NewFromOneByte instead", 1738 "Use NewFromUtf8 instead",
1739 V8_INLINE static Local<String> New(const char* data, int length = -1)); 1739 V8_INLINE static Local<String> New(const char* data, int length = -1));
1740 1740
1741 /** Allocates a new string from 16-bit character codes.*/ 1741 /** Allocates a new string from 16-bit character codes.*/
1742 V8_DEPRECATED( 1742 V8_DEPRECATED(
1743 "Use NewFromTwoByte instead", 1743 "Use NewFromTwoByte instead",
1744 V8_INLINE static Local<String> New( 1744 V8_INLINE static Local<String> New(
1745 const uint16_t* data, int length = -1)); 1745 const uint16_t* data, int length = -1));
1746 1746
1747 /** 1747 /**
1748 * Creates an internalized string (historically called a "symbol", 1748 * Creates an internalized string (historically called a "symbol",
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
2527 int GetScriptColumnNumber() const; 2527 int GetScriptColumnNumber() const;
2528 2528
2529 /** 2529 /**
2530 * Tells whether this function is builtin. 2530 * Tells whether this function is builtin.
2531 */ 2531 */
2532 bool IsBuiltin() const; 2532 bool IsBuiltin() const;
2533 2533
2534 /** 2534 /**
2535 * Returns scriptId object. 2535 * Returns scriptId object.
2536 */ 2536 */
2537 V8_DEPRECATED("Use ScriptId instead", Handle<Value> GetScriptId()) const; 2537 V8_DEPRECATED("Use ScriptId instead", Handle<Value> GetScriptId() const);
2538 2538
2539 /** 2539 /**
2540 * Returns scriptId. 2540 * Returns scriptId.
2541 */ 2541 */
2542 int ScriptId() const; 2542 int ScriptId() const;
2543 2543
2544 ScriptOrigin GetScriptOrigin() const; 2544 ScriptOrigin GetScriptOrigin() const;
2545 V8_INLINE static Function* Cast(Value* obj); 2545 V8_INLINE static Function* Cast(Value* obj);
2546 static const int kLineOffsetNotFound; 2546 static const int kLineOffsetNotFound;
2547 2547
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
2891 2891
2892 /** 2892 /**
2893 * An instance of the built-in Date constructor (ECMA-262, 15.9). 2893 * An instance of the built-in Date constructor (ECMA-262, 15.9).
2894 */ 2894 */
2895 class V8_EXPORT Date : public Object { 2895 class V8_EXPORT Date : public Object {
2896 public: 2896 public:
2897 static Local<Value> New(double time); 2897 static Local<Value> New(double time);
2898 2898
2899 V8_DEPRECATED( 2899 V8_DEPRECATED(
2900 "Use ValueOf instead", 2900 "Use ValueOf instead",
2901 double NumberValue()) const { return ValueOf(); } 2901 double NumberValue() const) { return ValueOf(); }
2902 2902
2903 /** 2903 /**
2904 * A specialization of Value::NumberValue that is more efficient 2904 * A specialization of Value::NumberValue that is more efficient
2905 * because we know the structure of this object. 2905 * because we know the structure of this object.
2906 */ 2906 */
2907 double ValueOf() const; 2907 double ValueOf() const;
2908 2908
2909 V8_INLINE static Date* Cast(v8::Value* obj); 2909 V8_INLINE static Date* Cast(v8::Value* obj);
2910 2910
2911 /** 2911 /**
(...skipping 17 matching lines...) Expand all
2929 2929
2930 /** 2930 /**
2931 * A Number object (ECMA-262, 4.3.21). 2931 * A Number object (ECMA-262, 4.3.21).
2932 */ 2932 */
2933 class V8_EXPORT NumberObject : public Object { 2933 class V8_EXPORT NumberObject : public Object {
2934 public: 2934 public:
2935 static Local<Value> New(double value); 2935 static Local<Value> New(double value);
2936 2936
2937 V8_DEPRECATED( 2937 V8_DEPRECATED(
2938 "Use ValueOf instead", 2938 "Use ValueOf instead",
2939 double NumberValue()) const { return ValueOf(); } 2939 double NumberValue() const) { return ValueOf(); }
2940 2940
2941 /** 2941 /**
2942 * Returns the Number held by the object. 2942 * Returns the Number held by the object.
2943 */ 2943 */
2944 double ValueOf() const; 2944 double ValueOf() const;
2945 2945
2946 V8_INLINE static NumberObject* Cast(v8::Value* obj); 2946 V8_INLINE static NumberObject* Cast(v8::Value* obj);
2947 2947
2948 private: 2948 private:
2949 static void CheckCast(v8::Value* obj); 2949 static void CheckCast(v8::Value* obj);
2950 }; 2950 };
2951 2951
2952 2952
2953 /** 2953 /**
2954 * A Boolean object (ECMA-262, 4.3.15). 2954 * A Boolean object (ECMA-262, 4.3.15).
2955 */ 2955 */
2956 class V8_EXPORT BooleanObject : public Object { 2956 class V8_EXPORT BooleanObject : public Object {
2957 public: 2957 public:
2958 static Local<Value> New(bool value); 2958 static Local<Value> New(bool value);
2959 2959
2960 V8_DEPRECATED( 2960 V8_DEPRECATED(
2961 "Use ValueOf instead", 2961 "Use ValueOf instead",
2962 bool BooleanValue()) const { return ValueOf(); } 2962 bool BooleanValue() const) { return ValueOf(); }
2963 2963
2964 /** 2964 /**
2965 * Returns the Boolean held by the object. 2965 * Returns the Boolean held by the object.
2966 */ 2966 */
2967 bool ValueOf() const; 2967 bool ValueOf() const;
2968 2968
2969 V8_INLINE static BooleanObject* Cast(v8::Value* obj); 2969 V8_INLINE static BooleanObject* Cast(v8::Value* obj);
2970 2970
2971 private: 2971 private:
2972 static void CheckCast(v8::Value* obj); 2972 static void CheckCast(v8::Value* obj);
2973 }; 2973 };
2974 2974
2975 2975
2976 /** 2976 /**
2977 * A String object (ECMA-262, 4.3.18). 2977 * A String object (ECMA-262, 4.3.18).
2978 */ 2978 */
2979 class V8_EXPORT StringObject : public Object { 2979 class V8_EXPORT StringObject : public Object {
2980 public: 2980 public:
2981 static Local<Value> New(Handle<String> value); 2981 static Local<Value> New(Handle<String> value);
2982 2982
2983 V8_DEPRECATED( 2983 V8_DEPRECATED(
2984 "Use ValueOf instead", 2984 "Use ValueOf instead",
2985 Local<String> StringValue()) const { return ValueOf(); } 2985 Local<String> StringValue() const) { return ValueOf(); }
2986 2986
2987 /** 2987 /**
2988 * Returns the String held by the object. 2988 * Returns the String held by the object.
2989 */ 2989 */
2990 Local<String> ValueOf() const; 2990 Local<String> ValueOf() const;
2991 2991
2992 V8_INLINE static StringObject* Cast(v8::Value* obj); 2992 V8_INLINE static StringObject* Cast(v8::Value* obj);
2993 2993
2994 private: 2994 private:
2995 static void CheckCast(v8::Value* obj); 2995 static void CheckCast(v8::Value* obj);
2996 }; 2996 };
2997 2997
2998 2998
2999 /** 2999 /**
3000 * A Symbol object (ECMA-262 edition 6). 3000 * A Symbol object (ECMA-262 edition 6).
3001 * 3001 *
3002 * This is an experimental feature. Use at your own risk. 3002 * This is an experimental feature. Use at your own risk.
3003 */ 3003 */
3004 class V8_EXPORT SymbolObject : public Object { 3004 class V8_EXPORT SymbolObject : public Object {
3005 public: 3005 public:
3006 static Local<Value> New(Isolate* isolate, Handle<Symbol> value); 3006 static Local<Value> New(Isolate* isolate, Handle<Symbol> value);
3007 3007
3008 V8_DEPRECATED( 3008 V8_DEPRECATED(
3009 "Use ValueOf instead", 3009 "Use ValueOf instead",
3010 Local<Symbol> SymbolValue()) const { return ValueOf(); } 3010 Local<Symbol> SymbolValue() const) { return ValueOf(); }
3011 3011
3012 /** 3012 /**
3013 * Returns the Symbol held by the object. 3013 * Returns the Symbol held by the object.
3014 */ 3014 */
3015 Local<Symbol> ValueOf() const; 3015 Local<Symbol> ValueOf() const;
3016 3016
3017 V8_INLINE static SymbolObject* Cast(v8::Value* obj); 3017 V8_INLINE static SymbolObject* Cast(v8::Value* obj);
3018 3018
3019 private: 3019 private:
3020 static void CheckCast(v8::Value* obj); 3020 static void CheckCast(v8::Value* obj);
(...skipping 3006 matching lines...) Expand 10 before | Expand all | Expand 10 after
6027 } 6027 }
6028 6028
6029 6029
6030 Handle<Boolean> Boolean::New(bool value) { 6030 Handle<Boolean> Boolean::New(bool value) {
6031 Isolate* isolate = Isolate::GetCurrent(); 6031 Isolate* isolate = Isolate::GetCurrent();
6032 return value ? True(isolate) : False(isolate); 6032 return value ? True(isolate) : False(isolate);
6033 } 6033 }
6034 6034
6035 6035
6036 void Template::Set(const char* name, v8::Handle<Data> value) { 6036 void Template::Set(const char* name, v8::Handle<Data> value) {
6037 Set(v8::String::New(name), value); 6037 Set(v8::String::NewFromUtf8(Isolate::GetCurrent(), name), value);
6038 } 6038 }
6039 6039
6040 6040
6041 Local<Value> Object::GetInternalField(int index) { 6041 Local<Value> Object::GetInternalField(int index) {
6042 #ifndef V8_ENABLE_CHECKS 6042 #ifndef V8_ENABLE_CHECKS
6043 typedef internal::Object O; 6043 typedef internal::Object O;
6044 typedef internal::HeapObject HO; 6044 typedef internal::HeapObject HO;
6045 typedef internal::Internals I; 6045 typedef internal::Internals I;
6046 O* obj = *reinterpret_cast<O**>(this); 6046 O* obj = *reinterpret_cast<O**>(this);
6047 // Fast path: If the object is a plain JSObject, which is the common case, we 6047 // Fast path: If the object is a plain JSObject, which is the common case, we
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
6580 */ 6580 */
6581 6581
6582 6582
6583 } // namespace v8 6583 } // namespace v8
6584 6584
6585 6585
6586 #undef TYPE_CHECK 6586 #undef TYPE_CHECK
6587 6587
6588 6588
6589 #endif // V8_H_ 6589 #endif // V8_H_
OLDNEW
« no previous file with comments | « build/standalone.gypi ('k') | samples/lineprocessor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698