Replace custom errors with native panic codes in DoubleEndedQueue (#4872)

Co-authored-by: ernestognw <ernestognw@gmail.com>
This commit is contained in:
Hadrien Croubois
2024-02-06 21:02:01 +01:00
committed by GitHub
parent e73913c3c1
commit 036c3cbef2
9 changed files with 71 additions and 39 deletions

View File

@ -74,6 +74,23 @@ import "@openzeppelin/{{__item_context.file.absolutePath}}";
--
{{/if}}
{{#if has-internal-variables}}
[.contract-index]
.Internal Variables
--
{{#each inheritance}}
{{#unless @first}}
[.contract-subindex-inherited]
.{{name}}
{{/unless}}
{{#each internal-variables}}
* {xref-{{anchor~}} }[`++{{typeDescriptions.typeString}} {{#if constant}}constant{{/if}} {{name}}++`]
{{/each}}
{{/each}}
--
{{/if}}
{{#each modifiers}}
[.contract-item]
[[{{anchor}}]]
@ -109,3 +126,12 @@ import "@openzeppelin/{{__item_context.file.absolutePath}}";
{{{natspec.dev}}}
{{/each}}
{{#each internal-variables}}
[.contract-item]
[[{{anchor}}]]
==== `{{typeDescriptions.typeString}} [.contract-item-name]#++{{name}}++#` [.item-kind]#internal{{#if constant}} constant{{/if}}#
{{{natspec.dev}}}
{{/each}}

View File

@ -39,6 +39,14 @@ module.exports['has-errors'] = function ({ item }) {
return item.inheritance.some(c => c.errors.length > 0);
};
module.exports['internal-variables'] = function ({ item }) {
return item.variables.filter(({ visibility }) => visibility === 'internal');
};
module.exports['has-internal-variables'] = function ({ item }) {
return module.exports['internal-variables']({ item }).length > 0;
};
module.exports.functions = function ({ item }) {
return [
...[...findAll('FunctionDefinition', item)].filter(f => f.visibility !== 'private'),