OLD | NEW |
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 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2712 }; | 2712 }; |
2713 | 2713 |
2714 | 2714 |
2715 /** | 2715 /** |
2716 * An instance of the built-in Date constructor (ECMA-262, 15.9). | 2716 * An instance of the built-in Date constructor (ECMA-262, 15.9). |
2717 */ | 2717 */ |
2718 class V8EXPORT Date : public Object { | 2718 class V8EXPORT Date : public Object { |
2719 public: | 2719 public: |
2720 static Local<Value> New(double time); | 2720 static Local<Value> New(double time); |
2721 | 2721 |
2722 // Deprecated, use Date::ValueOf() instead. | |
2723 // TODO(svenpanne) Actually deprecate when Chrome is adapted. | |
2724 double NumberValue() const { return ValueOf(); } | |
2725 | |
2726 /** | 2722 /** |
2727 * A specialization of Value::NumberValue that is more efficient | 2723 * A specialization of Value::NumberValue that is more efficient |
2728 * because we know the structure of this object. | 2724 * because we know the structure of this object. |
2729 */ | 2725 */ |
2730 double ValueOf() const; | 2726 double NumberValue() const; |
2731 | 2727 |
2732 V8_INLINE(static Date* Cast(v8::Value* obj)); | 2728 V8_INLINE(static Date* Cast(v8::Value* obj)); |
2733 | 2729 |
2734 /** | 2730 /** |
2735 * Notification that the embedder has changed the time zone, | 2731 * Notification that the embedder has changed the time zone, |
2736 * daylight savings time, or other date / time configuration | 2732 * daylight savings time, or other date / time configuration |
2737 * parameters. V8 keeps a cache of various values used for | 2733 * parameters. V8 keeps a cache of various values used for |
2738 * date / time computation. This notification will reset | 2734 * date / time computation. This notification will reset |
2739 * those cached values for the current context so that date / | 2735 * those cached values for the current context so that date / |
2740 * time configuration changes would be reflected in the Date | 2736 * time configuration changes would be reflected in the Date |
2741 * object. | 2737 * object. |
2742 * | 2738 * |
2743 * This API should not be called more than needed as it will | 2739 * This API should not be called more than needed as it will |
2744 * negatively impact the performance of date operations. | 2740 * negatively impact the performance of date operations. |
2745 */ | 2741 */ |
2746 static void DateTimeConfigurationChangeNotification(); | 2742 static void DateTimeConfigurationChangeNotification(); |
2747 | 2743 |
2748 private: | 2744 private: |
2749 static void CheckCast(v8::Value* obj); | 2745 static void CheckCast(v8::Value* obj); |
2750 }; | 2746 }; |
2751 | 2747 |
2752 | 2748 |
2753 /** | 2749 /** |
2754 * A Number object (ECMA-262, 4.3.21). | 2750 * A Number object (ECMA-262, 4.3.21). |
2755 */ | 2751 */ |
2756 class V8EXPORT NumberObject : public Object { | 2752 class V8EXPORT NumberObject : public Object { |
2757 public: | 2753 public: |
2758 static Local<Value> New(double value); | 2754 static Local<Value> New(double value); |
2759 | 2755 |
2760 // Deprecated, use NumberObject::ValueOf() instead. | |
2761 // TODO(svenpanne) Actually deprecate when Chrome is adapted. | |
2762 double NumberValue() const { return ValueOf(); } | |
2763 | |
2764 /** | 2756 /** |
2765 * Returns the Number held by the object. | 2757 * Returns the Number held by the object. |
2766 */ | 2758 */ |
2767 double ValueOf() const; | 2759 double NumberValue() const; |
2768 | 2760 |
2769 V8_INLINE(static NumberObject* Cast(v8::Value* obj)); | 2761 V8_INLINE(static NumberObject* Cast(v8::Value* obj)); |
2770 | 2762 |
2771 private: | 2763 private: |
2772 static void CheckCast(v8::Value* obj); | 2764 static void CheckCast(v8::Value* obj); |
2773 }; | 2765 }; |
2774 | 2766 |
2775 | 2767 |
2776 /** | 2768 /** |
2777 * A Boolean object (ECMA-262, 4.3.15). | 2769 * A Boolean object (ECMA-262, 4.3.15). |
2778 */ | 2770 */ |
2779 class V8EXPORT BooleanObject : public Object { | 2771 class V8EXPORT BooleanObject : public Object { |
2780 public: | 2772 public: |
2781 static Local<Value> New(bool value); | 2773 static Local<Value> New(bool value); |
2782 | 2774 |
2783 // Deprecated, use BooleanObject::ValueOf() instead. | |
2784 // TODO(svenpanne) Actually deprecate when Chrome is adapted. | |
2785 bool BooleanValue() const { return ValueOf(); } | |
2786 | |
2787 /** | 2775 /** |
2788 * Returns the Boolean held by the object. | 2776 * Returns the Boolean held by the object. |
2789 */ | 2777 */ |
2790 bool ValueOf() const; | 2778 bool BooleanValue() const; |
2791 | 2779 |
2792 V8_INLINE(static BooleanObject* Cast(v8::Value* obj)); | 2780 V8_INLINE(static BooleanObject* Cast(v8::Value* obj)); |
2793 | 2781 |
2794 private: | 2782 private: |
2795 static void CheckCast(v8::Value* obj); | 2783 static void CheckCast(v8::Value* obj); |
2796 }; | 2784 }; |
2797 | 2785 |
2798 | 2786 |
2799 /** | 2787 /** |
2800 * A String object (ECMA-262, 4.3.18). | 2788 * A String object (ECMA-262, 4.3.18). |
2801 */ | 2789 */ |
2802 class V8EXPORT StringObject : public Object { | 2790 class V8EXPORT StringObject : public Object { |
2803 public: | 2791 public: |
2804 static Local<Value> New(Handle<String> value); | 2792 static Local<Value> New(Handle<String> value); |
2805 | 2793 |
2806 // Deprecated, use StringObject::ValueOf() instead. | |
2807 // TODO(svenpanne) Actually deprecate when Chrome is adapted. | |
2808 Local<String> StringValue() const { return ValueOf(); } | |
2809 | |
2810 /** | 2794 /** |
2811 * Returns the String held by the object. | 2795 * Returns the String held by the object. |
2812 */ | 2796 */ |
2813 Local<String> ValueOf() const; | 2797 Local<String> StringValue() const; |
2814 | 2798 |
2815 V8_INLINE(static StringObject* Cast(v8::Value* obj)); | 2799 V8_INLINE(static StringObject* Cast(v8::Value* obj)); |
2816 | 2800 |
2817 private: | 2801 private: |
2818 static void CheckCast(v8::Value* obj); | 2802 static void CheckCast(v8::Value* obj); |
2819 }; | 2803 }; |
2820 | 2804 |
2821 | 2805 |
2822 /** | 2806 /** |
2823 * A Symbol object (ECMA-262 edition 6). | 2807 * A Symbol object (ECMA-262 edition 6). |
2824 * | 2808 * |
2825 * This is an experimental feature. Use at your own risk. | 2809 * This is an experimental feature. Use at your own risk. |
2826 */ | 2810 */ |
2827 class V8EXPORT SymbolObject : public Object { | 2811 class V8EXPORT SymbolObject : public Object { |
2828 public: | 2812 public: |
2829 static Local<Value> New(Isolate* isolate, Handle<Symbol> value); | 2813 static Local<Value> New(Isolate* isolate, Handle<Symbol> value); |
2830 | 2814 |
2831 // Deprecated, use SymbolObject::ValueOf() instead. | |
2832 // TODO(svenpanne) Actually deprecate when Chrome is adapted. | |
2833 Local<Symbol> SymbolValue() const { return ValueOf(); } | |
2834 | |
2835 /** | 2815 /** |
2836 * Returns the Symbol held by the object. | 2816 * Returns the Symbol held by the object. |
2837 */ | 2817 */ |
2838 Local<Symbol> ValueOf() const; | 2818 Local<Symbol> SymbolValue() const; |
2839 | 2819 |
2840 V8_INLINE(static SymbolObject* Cast(v8::Value* obj)); | 2820 V8_INLINE(static SymbolObject* Cast(v8::Value* obj)); |
2841 | 2821 |
2842 private: | 2822 private: |
2843 static void CheckCast(v8::Value* obj); | 2823 static void CheckCast(v8::Value* obj); |
2844 }; | 2824 }; |
2845 | 2825 |
2846 | 2826 |
2847 /** | 2827 /** |
2848 * An instance of the built-in RegExp constructor (ECMA-262, 15.10). | 2828 * An instance of the built-in RegExp constructor (ECMA-262, 15.10). |
(...skipping 3652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6501 | 6481 |
6502 | 6482 |
6503 } // namespace v8 | 6483 } // namespace v8 |
6504 | 6484 |
6505 | 6485 |
6506 #undef V8EXPORT | 6486 #undef V8EXPORT |
6507 #undef TYPE_CHECK | 6487 #undef TYPE_CHECK |
6508 | 6488 |
6509 | 6489 |
6510 #endif // V8_H_ | 6490 #endif // V8_H_ |
OLD | NEW |