OLD | NEW |
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 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 private: | 954 private: |
955 Data(); | 955 Data(); |
956 }; | 956 }; |
957 | 957 |
958 | 958 |
959 /** | 959 /** |
960 * The optional attributes of ScriptOrigin. | 960 * The optional attributes of ScriptOrigin. |
961 */ | 961 */ |
962 class ScriptOriginOptions { | 962 class ScriptOriginOptions { |
963 public: | 963 public: |
964 V8_INLINE ScriptOriginOptions(bool is_embedder_debug_script = false, | 964 V8_INLINE ScriptOriginOptions(bool is_shared_cross_origin = false, |
965 bool is_shared_cross_origin = false, | |
966 bool is_opaque = false) | 965 bool is_opaque = false) |
967 : flags_((is_embedder_debug_script ? kIsEmbedderDebugScript : 0) | | 966 : flags_((is_shared_cross_origin ? kIsSharedCrossOrigin : 0) | |
968 (is_shared_cross_origin ? kIsSharedCrossOrigin : 0) | | |
969 (is_opaque ? kIsOpaque : 0)) {} | 967 (is_opaque ? kIsOpaque : 0)) {} |
970 V8_INLINE ScriptOriginOptions(int flags) | 968 V8_INLINE ScriptOriginOptions(int flags) |
971 : flags_(flags & | 969 : flags_(flags & (kIsSharedCrossOrigin | kIsOpaque)) {} |
972 (kIsEmbedderDebugScript | kIsSharedCrossOrigin | kIsOpaque)) {} | |
973 bool IsEmbedderDebugScript() const { | |
974 return (flags_ & kIsEmbedderDebugScript) != 0; | |
975 } | |
976 bool IsSharedCrossOrigin() const { | 970 bool IsSharedCrossOrigin() const { |
977 return (flags_ & kIsSharedCrossOrigin) != 0; | 971 return (flags_ & kIsSharedCrossOrigin) != 0; |
978 } | 972 } |
979 bool IsOpaque() const { return (flags_ & kIsOpaque) != 0; } | 973 bool IsOpaque() const { return (flags_ & kIsOpaque) != 0; } |
980 int Flags() const { return flags_; } | 974 int Flags() const { return flags_; } |
981 | 975 |
982 private: | 976 private: |
983 enum { | 977 enum { kIsSharedCrossOrigin = 1, kIsOpaque = 1 << 1 }; |
984 kIsEmbedderDebugScript = 1, | |
985 kIsSharedCrossOrigin = 1 << 1, | |
986 kIsOpaque = 1 << 2 | |
987 }; | |
988 const int flags_; | 978 const int flags_; |
989 }; | 979 }; |
990 | 980 |
991 /** | 981 /** |
992 * The origin, within a file, of a script. | 982 * The origin, within a file, of a script. |
993 */ | 983 */ |
994 class ScriptOrigin { | 984 class ScriptOrigin { |
995 public: | 985 public: |
996 V8_INLINE ScriptOrigin( | 986 V8_INLINE ScriptOrigin( |
997 Local<Value> resource_name, | 987 Local<Value> resource_name, |
998 Local<Integer> resource_line_offset = Local<Integer>(), | 988 Local<Integer> resource_line_offset = Local<Integer>(), |
999 Local<Integer> resource_column_offset = Local<Integer>(), | 989 Local<Integer> resource_column_offset = Local<Integer>(), |
1000 Local<Boolean> resource_is_shared_cross_origin = Local<Boolean>(), | 990 Local<Boolean> resource_is_shared_cross_origin = Local<Boolean>(), |
1001 Local<Integer> script_id = Local<Integer>(), | 991 Local<Integer> script_id = Local<Integer>(), |
1002 Local<Boolean> resource_is_embedder_debug_script = Local<Boolean>(), | |
1003 Local<Value> source_map_url = Local<Value>(), | 992 Local<Value> source_map_url = Local<Value>(), |
1004 Local<Boolean> resource_is_opaque = Local<Boolean>()); | 993 Local<Boolean> resource_is_opaque = Local<Boolean>()); |
| 994 |
| 995 V8_DEPRECATE_SOON( |
| 996 "Use version without resource_is_embedder_debug_script flag", |
| 997 V8_INLINE ScriptOrigin(Local<Value> resource_name, |
| 998 Local<Integer> resource_line_offset, |
| 999 Local<Integer> resource_column_offset, |
| 1000 Local<Boolean> resource_is_shared_cross_origin, |
| 1001 Local<Integer> script_id, |
| 1002 Local<Boolean> resource_is_embedder_debug_script, |
| 1003 Local<Value> source_map_url, |
| 1004 Local<Boolean> resource_is_opaque)); |
| 1005 |
1005 V8_INLINE Local<Value> ResourceName() const; | 1006 V8_INLINE Local<Value> ResourceName() const; |
1006 V8_INLINE Local<Integer> ResourceLineOffset() const; | 1007 V8_INLINE Local<Integer> ResourceLineOffset() const; |
1007 V8_INLINE Local<Integer> ResourceColumnOffset() const; | 1008 V8_INLINE Local<Integer> ResourceColumnOffset() const; |
1008 /** | 1009 /** |
1009 * Returns true for embedder's debugger scripts | 1010 * Returns true for embedder's debugger scripts |
1010 */ | 1011 */ |
1011 V8_INLINE Local<Integer> ScriptID() const; | 1012 V8_INLINE Local<Integer> ScriptID() const; |
1012 V8_INLINE Local<Value> SourceMapUrl() const; | 1013 V8_INLINE Local<Value> SourceMapUrl() const; |
1013 V8_INLINE ScriptOriginOptions Options() const { return options_; } | 1014 V8_INLINE ScriptOriginOptions Options() const { return options_; } |
1014 | 1015 |
(...skipping 7840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8855 Local<Integer> resource_line_offset, | 8856 Local<Integer> resource_line_offset, |
8856 Local<Integer> resource_column_offset, | 8857 Local<Integer> resource_column_offset, |
8857 Local<Boolean> resource_is_shared_cross_origin, | 8858 Local<Boolean> resource_is_shared_cross_origin, |
8858 Local<Integer> script_id, | 8859 Local<Integer> script_id, |
8859 Local<Boolean> resource_is_embedder_debug_script, | 8860 Local<Boolean> resource_is_embedder_debug_script, |
8860 Local<Value> source_map_url, | 8861 Local<Value> source_map_url, |
8861 Local<Boolean> resource_is_opaque) | 8862 Local<Boolean> resource_is_opaque) |
8862 : resource_name_(resource_name), | 8863 : resource_name_(resource_name), |
8863 resource_line_offset_(resource_line_offset), | 8864 resource_line_offset_(resource_line_offset), |
8864 resource_column_offset_(resource_column_offset), | 8865 resource_column_offset_(resource_column_offset), |
8865 options_(!resource_is_embedder_debug_script.IsEmpty() && | 8866 options_(!resource_is_shared_cross_origin.IsEmpty() && |
8866 resource_is_embedder_debug_script->IsTrue(), | |
8867 !resource_is_shared_cross_origin.IsEmpty() && | |
8868 resource_is_shared_cross_origin->IsTrue(), | 8867 resource_is_shared_cross_origin->IsTrue(), |
8869 !resource_is_opaque.IsEmpty() && resource_is_opaque->IsTrue()), | 8868 !resource_is_opaque.IsEmpty() && resource_is_opaque->IsTrue()), |
8870 script_id_(script_id), | 8869 script_id_(script_id), |
| 8870 source_map_url_(source_map_url) {} |
| 8871 |
| 8872 ScriptOrigin::ScriptOrigin(Local<Value> resource_name, |
| 8873 Local<Integer> resource_line_offset, |
| 8874 Local<Integer> resource_column_offset, |
| 8875 Local<Boolean> resource_is_shared_cross_origin, |
| 8876 Local<Integer> script_id, |
| 8877 Local<Value> source_map_url, |
| 8878 Local<Boolean> resource_is_opaque) |
| 8879 : resource_name_(resource_name), |
| 8880 resource_line_offset_(resource_line_offset), |
| 8881 resource_column_offset_(resource_column_offset), |
| 8882 options_(!resource_is_shared_cross_origin.IsEmpty() && |
| 8883 resource_is_shared_cross_origin->IsTrue(), |
| 8884 !resource_is_opaque.IsEmpty() && resource_is_opaque->IsTrue()), |
| 8885 script_id_(script_id), |
8871 source_map_url_(source_map_url) {} | 8886 source_map_url_(source_map_url) {} |
8872 | 8887 |
8873 Local<Value> ScriptOrigin::ResourceName() const { return resource_name_; } | 8888 Local<Value> ScriptOrigin::ResourceName() const { return resource_name_; } |
8874 | 8889 |
8875 | 8890 |
8876 Local<Integer> ScriptOrigin::ResourceLineOffset() const { | 8891 Local<Integer> ScriptOrigin::ResourceLineOffset() const { |
8877 return resource_line_offset_; | 8892 return resource_line_offset_; |
8878 } | 8893 } |
8879 | 8894 |
8880 | 8895 |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9688 */ | 9703 */ |
9689 | 9704 |
9690 | 9705 |
9691 } // namespace v8 | 9706 } // namespace v8 |
9692 | 9707 |
9693 | 9708 |
9694 #undef TYPE_CHECK | 9709 #undef TYPE_CHECK |
9695 | 9710 |
9696 | 9711 |
9697 #endif // INCLUDE_V8_H_ | 9712 #endif // INCLUDE_V8_H_ |
OLD | NEW |