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

Side by Side Diff: include/v8.h

Issue 1801203002: Parser: Make skipping HTML comments optional. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 4 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 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 }; 998 };
999 999
1000 1000
1001 /** 1001 /**
1002 * The optional attributes of ScriptOrigin. 1002 * The optional attributes of ScriptOrigin.
1003 */ 1003 */
1004 class ScriptOriginOptions { 1004 class ScriptOriginOptions {
1005 public: 1005 public:
1006 V8_INLINE ScriptOriginOptions(bool is_embedder_debug_script = false, 1006 V8_INLINE ScriptOriginOptions(bool is_embedder_debug_script = false,
1007 bool is_shared_cross_origin = false, 1007 bool is_shared_cross_origin = false,
1008 bool is_opaque = false) 1008 bool is_opaque = false,
1009 bool allow_html_comments = false)
1009 : flags_((is_embedder_debug_script ? kIsEmbedderDebugScript : 0) | 1010 : flags_((is_embedder_debug_script ? kIsEmbedderDebugScript : 0) |
1010 (is_shared_cross_origin ? kIsSharedCrossOrigin : 0) | 1011 (is_shared_cross_origin ? kIsSharedCrossOrigin : 0) |
1011 (is_opaque ? kIsOpaque : 0)) {} 1012 (is_opaque ? kIsOpaque : 0) |
1013 (allow_html_comments ? kAllowHtmlComments : 0)) {}
1012 V8_INLINE ScriptOriginOptions(int flags) 1014 V8_INLINE ScriptOriginOptions(int flags)
1013 : flags_(flags & 1015 : flags_(flags & (kIsEmbedderDebugScript | kIsSharedCrossOrigin |
1014 (kIsEmbedderDebugScript | kIsSharedCrossOrigin | kIsOpaque)) {} 1016 kIsOpaque | kAllowHtmlComments)) {}
1015 bool IsEmbedderDebugScript() const { 1017 bool IsEmbedderDebugScript() const { return HasFlag(kIsEmbedderDebugScript); }
1016 return (flags_ & kIsEmbedderDebugScript) != 0; 1018 bool IsSharedCrossOrigin() const { return HasFlag(kIsSharedCrossOrigin); }
1017 } 1019 bool IsOpaque() const { return HasFlag(kIsOpaque); }
1018 bool IsSharedCrossOrigin() const { 1020 bool AllowHtmlComments() const { return HasFlag(kAllowHtmlComments); }
1019 return (flags_ & kIsSharedCrossOrigin) != 0;
1020 }
1021 bool IsOpaque() const { return (flags_ & kIsOpaque) != 0; }
1022 int Flags() const { return flags_; } 1021 int Flags() const { return flags_; }
1023 1022
1024 private: 1023 private:
1025 enum { 1024 enum {
1026 kIsEmbedderDebugScript = 1, 1025 kIsEmbedderDebugScript = 1,
1027 kIsSharedCrossOrigin = 1 << 1, 1026 kIsSharedCrossOrigin = 1 << 1,
1028 kIsOpaque = 1 << 2 1027 kIsOpaque = 1 << 2,
1028 kAllowHtmlComments = 1 << 3
1029 }; 1029 };
1030
1031 inline bool HasFlag(int flag) const { return (flags_ & flag) != 0; }
1032
1030 const int flags_; 1033 const int flags_;
1031 }; 1034 };
1032 1035
1033 /** 1036 /**
1034 * The origin, within a file, of a script. 1037 * The origin, within a file, of a script.
1035 */ 1038 */
1036 class ScriptOrigin { 1039 class ScriptOrigin {
1037 public: 1040 public:
1038 V8_INLINE ScriptOrigin( 1041 V8_INLINE ScriptOrigin(
1039 Local<Value> resource_name, 1042 Local<Value> resource_name,
1040 Local<Integer> resource_line_offset = Local<Integer>(), 1043 Local<Integer> resource_line_offset = Local<Integer>(),
1041 Local<Integer> resource_column_offset = Local<Integer>(), 1044 Local<Integer> resource_column_offset = Local<Integer>(),
1042 Local<Boolean> resource_is_shared_cross_origin = Local<Boolean>(), 1045 Local<Boolean> resource_is_shared_cross_origin = Local<Boolean>(),
1043 Local<Integer> script_id = Local<Integer>(), 1046 Local<Integer> script_id = Local<Integer>(),
1044 Local<Boolean> resource_is_embedder_debug_script = Local<Boolean>(), 1047 Local<Boolean> resource_is_embedder_debug_script = Local<Boolean>(),
1045 Local<Value> source_map_url = Local<Value>(), 1048 Local<Value> source_map_url = Local<Value>(),
1046 Local<Boolean> resource_is_opaque = Local<Boolean>()); 1049 Local<Boolean> resource_is_opaque = Local<Boolean>(),
1050 Local<Boolean> allow_html_comments = Local<Boolean>());
1047 V8_INLINE Local<Value> ResourceName() const; 1051 V8_INLINE Local<Value> ResourceName() const;
1048 V8_INLINE Local<Integer> ResourceLineOffset() const; 1052 V8_INLINE Local<Integer> ResourceLineOffset() const;
1049 V8_INLINE Local<Integer> ResourceColumnOffset() const; 1053 V8_INLINE Local<Integer> ResourceColumnOffset() const;
1050 /** 1054 /**
1051 * Returns true for embedder's debugger scripts 1055 * Returns true for embedder's debugger scripts
1052 */ 1056 */
1053 V8_INLINE Local<Integer> ScriptID() const; 1057 V8_INLINE Local<Integer> ScriptID() const;
1054 V8_INLINE Local<Value> SourceMapUrl() const; 1058 V8_INLINE Local<Value> SourceMapUrl() const;
1055 V8_INLINE ScriptOriginOptions Options() const { return options_; } 1059 V8_INLINE ScriptOriginOptions Options() const { return options_; }
1056 1060
(...skipping 6764 matching lines...) Expand 10 before | Expand all | Expand 10 after
7821 return length_; 7825 return length_;
7822 } 7826 }
7823 7827
7824 ScriptOrigin::ScriptOrigin(Local<Value> resource_name, 7828 ScriptOrigin::ScriptOrigin(Local<Value> resource_name,
7825 Local<Integer> resource_line_offset, 7829 Local<Integer> resource_line_offset,
7826 Local<Integer> resource_column_offset, 7830 Local<Integer> resource_column_offset,
7827 Local<Boolean> resource_is_shared_cross_origin, 7831 Local<Boolean> resource_is_shared_cross_origin,
7828 Local<Integer> script_id, 7832 Local<Integer> script_id,
7829 Local<Boolean> resource_is_embedder_debug_script, 7833 Local<Boolean> resource_is_embedder_debug_script,
7830 Local<Value> source_map_url, 7834 Local<Value> source_map_url,
7831 Local<Boolean> resource_is_opaque) 7835 Local<Boolean> resource_is_opaque,
7836 Local<Boolean> allow_html_comments)
7832 : resource_name_(resource_name), 7837 : resource_name_(resource_name),
7833 resource_line_offset_(resource_line_offset), 7838 resource_line_offset_(resource_line_offset),
7834 resource_column_offset_(resource_column_offset), 7839 resource_column_offset_(resource_column_offset),
7835 options_(!resource_is_embedder_debug_script.IsEmpty() && 7840 options_(!resource_is_embedder_debug_script.IsEmpty() &&
7836 resource_is_embedder_debug_script->IsTrue(), 7841 resource_is_embedder_debug_script->IsTrue(),
7837 !resource_is_shared_cross_origin.IsEmpty() && 7842 !resource_is_shared_cross_origin.IsEmpty() &&
7838 resource_is_shared_cross_origin->IsTrue(), 7843 resource_is_shared_cross_origin->IsTrue(),
7839 !resource_is_opaque.IsEmpty() && resource_is_opaque->IsTrue()), 7844 !resource_is_opaque.IsEmpty() && resource_is_opaque->IsTrue(),
7845 allow_html_comments.IsEmpty() || allow_html_comments->IsTrue()),
7840 script_id_(script_id), 7846 script_id_(script_id),
7841 source_map_url_(source_map_url) {} 7847 source_map_url_(source_map_url) {}
7842 7848
7843 Local<Value> ScriptOrigin::ResourceName() const { return resource_name_; } 7849 Local<Value> ScriptOrigin::ResourceName() const { return resource_name_; }
7844 7850
7845 7851
7846 Local<Integer> ScriptOrigin::ResourceLineOffset() const { 7852 Local<Integer> ScriptOrigin::ResourceLineOffset() const {
7847 return resource_line_offset_; 7853 return resource_line_offset_;
7848 } 7854 }
7849 7855
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
8670 */ 8676 */
8671 8677
8672 8678
8673 } // namespace v8 8679 } // namespace v8
8674 8680
8675 8681
8676 #undef TYPE_CHECK 8682 #undef TYPE_CHECK
8677 8683
8678 8684
8679 #endif // INCLUDE_V8_H_ 8685 #endif // INCLUDE_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