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

Side by Side Diff: src/accessors.h

Issue 1632603002: [api] Default native data property setter to replace the setter if the property is writable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/accessors.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 #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 26 matching lines...) Expand all
37 V(ScriptLineEnds) \ 37 V(ScriptLineEnds) \
38 V(ScriptLineOffset) \ 38 V(ScriptLineOffset) \
39 V(ScriptName) \ 39 V(ScriptName) \
40 V(ScriptSource) \ 40 V(ScriptSource) \
41 V(ScriptType) \ 41 V(ScriptType) \
42 V(ScriptSourceUrl) \ 42 V(ScriptSourceUrl) \
43 V(ScriptSourceMappingUrl) \ 43 V(ScriptSourceMappingUrl) \
44 V(ScriptIsEmbedderDebugScript) \ 44 V(ScriptIsEmbedderDebugScript) \
45 V(StringLength) 45 V(StringLength)
46 46
47 #define ACCESSOR_SETTER_LIST(V) \
48 V(ReconfigureToDataProperty) \
49 V(ObservedReconfigureToDataProperty) \
50 V(ArrayLengthSetter) \
51 V(FunctionPrototypeSetter)
52
47 // Accessors contains all predefined proxy accessors. 53 // Accessors contains all predefined proxy accessors.
48 54
49 class Accessors : public AllStatic { 55 class Accessors : public AllStatic {
50 public: 56 public:
51 // Accessor descriptors. 57 // Accessor descriptors.
52 #define ACCESSOR_INFO_DECLARATION(name) \ 58 #define ACCESSOR_INFO_DECLARATION(name) \
53 static void name##Getter( \ 59 static void name##Getter( \
54 v8::Local<v8::Name> name, \ 60 v8::Local<v8::Name> name, \
55 const v8::PropertyCallbackInfo<v8::Value>& info); \ 61 const v8::PropertyCallbackInfo<v8::Value>& info); \
56 static void name##Setter( \
57 v8::Local<v8::Name> name, \
58 v8::Local<v8::Value> value, \
59 const v8::PropertyCallbackInfo<void>& info); \
60 static Handle<AccessorInfo> name##Info( \ 62 static Handle<AccessorInfo> name##Info( \
61 Isolate* isolate, \ 63 Isolate* isolate, \
62 PropertyAttributes attributes); 64 PropertyAttributes attributes);
63 ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION) 65 ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION)
64 #undef ACCESSOR_INFO_DECLARATION 66 #undef ACCESSOR_INFO_DECLARATION
65 67
68 #define ACCESSOR_SETTER_DECLARATION(name) \
69 static void name(v8::Local<v8::Name> name, v8::Local<v8::Value> value, \
70 const v8::PropertyCallbackInfo<void>& info);
71 ACCESSOR_SETTER_LIST(ACCESSOR_SETTER_DECLARATION)
72 #undef ACCESSOR_SETTER_DECLARATION
73
66 enum DescriptorId { 74 enum DescriptorId {
67 #define ACCESSOR_INFO_DECLARATION(name) \ 75 #define ACCESSOR_INFO_DECLARATION(name) \
68 k##name##Getter, \ 76 k##name##Getter, \
69 k##name##Setter, 77 k##name##Setter,
70 ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION) 78 ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION)
71 #undef ACCESSOR_INFO_DECLARATION 79 #undef ACCESSOR_INFO_DECLARATION
72 descriptorCount 80 descriptorCount
73 }; 81 };
74 82
75 // Accessor functions called directly from the runtime system. 83 // Accessor functions called directly from the runtime system.
(...skipping 23 matching lines...) Expand all
99 Handle<Name> name, 107 Handle<Name> name,
100 AccessorNameGetterCallback getter, 108 AccessorNameGetterCallback getter,
101 AccessorNameSetterCallback setter, 109 AccessorNameSetterCallback setter,
102 PropertyAttributes attributes); 110 PropertyAttributes attributes);
103 }; 111 };
104 112
105 } // namespace internal 113 } // namespace internal
106 } // namespace v8 114 } // namespace v8
107 115
108 #endif // V8_ACCESSORS_H_ 116 #endif // V8_ACCESSORS_H_
OLDNEW
« no previous file with comments | « no previous file | src/accessors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698