diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2021-01-28 23:22:18 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2021-02-08 14:00:31 +0800 |
commit | 1b7531cdeb46db2c315015f9138d95585b1064a9 (patch) | |
tree | da791b3e3cc0e514f9c84c06904031e231ec75a2 /src/README.md | |
parent | b346cd1760dfad560d89cb797be2cf6f9f77bb77 (diff) | |
download | node-new-1b7531cdeb46db2c315015f9138d95585b1064a9.tar.gz |
src: rename binding_data_name to type_name in BindingData
Previously, this was a per-class string constant for BindingData
which is used as keys for identifying these objects in the binding
data map. These are just type names of the BindingData.
This patch renames the variable to type_name so that
we can generalize this constant for other BaseObjects and use
it for debugging and logging the types of other BaseObjects.
PR-URL: https://github.com/nodejs/node/pull/37112
Refs: https://github.com/nodejs/node/pull/36943
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Diffstat (limited to 'src/README.md')
-rw-r--r-- | src/README.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/README.md b/src/README.md index aec56e7a7b..a3b54416a0 100644 --- a/src/README.md +++ b/src/README.md @@ -422,7 +422,7 @@ that state is through the use of `Environment::AddBindingData`, which gives binding functions access to an object for storing such state. That object is always a [`BaseObject`][]. -Its class needs to have a static `binding_data_name` field based on a +Its class needs to have a static `type_name` field based on a constant string, in order to disambiguate it from other classes of this type, and which could e.g. match the binding’s name (in the example above, that would be `cares_wrap`). @@ -433,7 +433,7 @@ class BindingData : public BaseObject { public: BindingData(Environment* env, Local<Object> obj) : BaseObject(env, obj) {} - static constexpr FastStringKey binding_data_name { "http_parser" }; + static constexpr FastStringKey type_name { "http_parser" }; std::vector<char> parser_buffer; bool parser_buffer_in_use = false; |