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 #ifndef V8_ACCESSORS_H_ | 5 #ifndef V8_ACCESSORS_H_ |
6 #define V8_ACCESSORS_H_ | 6 #define V8_ACCESSORS_H_ |
7 | 7 |
8 #include "include/v8.h" | 8 #include "include/v8.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 V(ArgumentsIterator) \ | 23 V(ArgumentsIterator) \ |
24 V(ArrayLength) \ | 24 V(ArrayLength) \ |
25 V(BoundFunctionLength) \ | 25 V(BoundFunctionLength) \ |
26 V(BoundFunctionName) \ | 26 V(BoundFunctionName) \ |
27 V(ErrorStack) \ | 27 V(ErrorStack) \ |
28 V(FunctionArguments) \ | 28 V(FunctionArguments) \ |
29 V(FunctionCaller) \ | 29 V(FunctionCaller) \ |
30 V(FunctionName) \ | 30 V(FunctionName) \ |
31 V(FunctionLength) \ | 31 V(FunctionLength) \ |
32 V(FunctionPrototype) \ | 32 V(FunctionPrototype) \ |
| 33 V(ModuleNamespaceToStringTag) \ |
33 V(ScriptColumnOffset) \ | 34 V(ScriptColumnOffset) \ |
34 V(ScriptCompilationType) \ | 35 V(ScriptCompilationType) \ |
35 V(ScriptContextData) \ | 36 V(ScriptContextData) \ |
36 V(ScriptEvalFromScript) \ | 37 V(ScriptEvalFromScript) \ |
37 V(ScriptEvalFromScriptPosition) \ | 38 V(ScriptEvalFromScriptPosition) \ |
38 V(ScriptEvalFromFunctionName) \ | 39 V(ScriptEvalFromFunctionName) \ |
39 V(ScriptId) \ | 40 V(ScriptId) \ |
40 V(ScriptLineEnds) \ | 41 V(ScriptLineEnds) \ |
41 V(ScriptLineOffset) \ | 42 V(ScriptLineOffset) \ |
42 V(ScriptName) \ | 43 V(ScriptName) \ |
43 V(ScriptSource) \ | 44 V(ScriptSource) \ |
44 V(ScriptType) \ | 45 V(ScriptType) \ |
45 V(ScriptSourceUrl) \ | 46 V(ScriptSourceUrl) \ |
46 V(ScriptSourceMappingUrl) \ | 47 V(ScriptSourceMappingUrl) \ |
47 V(ScriptIsEmbedderDebugScript) \ | 48 V(ScriptIsEmbedderDebugScript) \ |
48 V(StringLength) | 49 V(StringLength) |
49 | 50 |
50 #define ACCESSOR_SETTER_LIST(V) \ | 51 #define ACCESSOR_SETTER_LIST(V) \ |
51 V(ReconfigureToDataProperty) \ | |
52 V(ArrayLengthSetter) \ | 52 V(ArrayLengthSetter) \ |
53 V(ErrorStackSetter) \ | 53 V(ErrorStackSetter) \ |
54 V(FunctionPrototypeSetter) | 54 V(FunctionPrototypeSetter) \ |
| 55 V(ModuleNamespaceEntrySetter) \ |
| 56 V(ReconfigureToDataProperty) |
55 | 57 |
56 // Accessors contains all predefined proxy accessors. | 58 // Accessors contains all predefined proxy accessors. |
57 | 59 |
58 class Accessors : public AllStatic { | 60 class Accessors : public AllStatic { |
59 public: | 61 public: |
60 // Accessor descriptors. | 62 // Accessor descriptors. |
61 #define ACCESSOR_INFO_DECLARATION(name) \ | 63 #define ACCESSOR_INFO_DECLARATION(name) \ |
62 static void name##Getter( \ | 64 static void name##Getter( \ |
63 v8::Local<v8::Name> name, \ | 65 v8::Local<v8::Name> name, \ |
64 const v8::PropertyCallbackInfo<v8::Value>& info); \ | 66 const v8::PropertyCallbackInfo<v8::Value>& info); \ |
65 static Handle<AccessorInfo> name##Info( \ | 67 static Handle<AccessorInfo> name##Info( \ |
66 Isolate* isolate, \ | 68 Isolate* isolate, \ |
67 PropertyAttributes attributes); | 69 PropertyAttributes attributes); |
68 ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION) | 70 ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION) |
69 #undef ACCESSOR_INFO_DECLARATION | 71 #undef ACCESSOR_INFO_DECLARATION |
70 | 72 |
71 #define ACCESSOR_SETTER_DECLARATION(name) \ | 73 #define ACCESSOR_SETTER_DECLARATION(name) \ |
72 static void name(v8::Local<v8::Name> name, v8::Local<v8::Value> value, \ | 74 static void name(v8::Local<v8::Name> name, v8::Local<v8::Value> value, \ |
73 const v8::PropertyCallbackInfo<void>& info); | 75 const v8::PropertyCallbackInfo<void>& info); |
74 ACCESSOR_SETTER_LIST(ACCESSOR_SETTER_DECLARATION) | 76 ACCESSOR_SETTER_LIST(ACCESSOR_SETTER_DECLARATION) |
75 #undef ACCESSOR_SETTER_DECLARATION | 77 #undef ACCESSOR_SETTER_DECLARATION |
76 | 78 |
| 79 static void ModuleNamespaceEntryGetter( |
| 80 v8::Local<v8::Name> name, |
| 81 const v8::PropertyCallbackInfo<v8::Value>& info); |
| 82 static Handle<AccessorInfo> ModuleNamespaceEntryInfo( |
| 83 Isolate* isolate, Handle<String> name, PropertyAttributes attributes); |
| 84 |
77 enum DescriptorId { | 85 enum DescriptorId { |
78 #define ACCESSOR_INFO_DECLARATION(name) \ | 86 #define ACCESSOR_INFO_DECLARATION(name) \ |
79 k##name##Getter, \ | 87 k##name##Getter, \ |
80 k##name##Setter, | 88 k##name##Setter, |
81 ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION) | 89 ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION) |
82 #undef ACCESSOR_INFO_DECLARATION | 90 #undef ACCESSOR_INFO_DECLARATION |
83 descriptorCount | 91 descriptorCount |
84 }; | 92 }; |
85 | 93 |
86 // Accessor functions called directly from the runtime system. | 94 // Accessor functions called directly from the runtime system. |
(...skipping 11 matching lines...) Expand all Loading... |
98 Handle<Name> name, | 106 Handle<Name> name, |
99 AccessorNameGetterCallback getter, | 107 AccessorNameGetterCallback getter, |
100 AccessorNameSetterCallback setter, | 108 AccessorNameSetterCallback setter, |
101 PropertyAttributes attributes); | 109 PropertyAttributes attributes); |
102 }; | 110 }; |
103 | 111 |
104 } // namespace internal | 112 } // namespace internal |
105 } // namespace v8 | 113 } // namespace v8 |
106 | 114 |
107 #endif // V8_ACCESSORS_H_ | 115 #endif // V8_ACCESSORS_H_ |
OLD | NEW |