WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 161793
JSDOMBindings' toArguments() should return a more descriptive object
https://bugs.webkit.org/show_bug.cgi?id=161793
Summary
JSDOMBindings' toArguments() should return a more descriptive object
Nael Ouedraogo
Reported
2016-09-09 05:37:21 PDT
JSDOMBindings' toArguments() returns a std::pair of argumentIndex and Optional. In JS bindings code generator, use of ".first" and ".second" to access to members is hard to read. We should use a struct instead to be able to name the members.
Attachments
Patch
(11.36 KB, patch)
2016-09-09 07:06 PDT
,
Nael Ouedraogo
no flags
Details
Formatted Diff
Diff
Patch
(6.22 KB, patch)
2016-09-13 01:52 PDT
,
Nael Ouedraogo
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Nael Ouedraogo
Comment 1
2016-09-09 07:06:13 PDT
Created
attachment 288400
[details]
Patch
Chris Dumez
Comment 2
2016-09-09 09:11:20 PDT
Comment on
attachment 288400
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=288400&action=review
> Source/WebCore/bindings/js/JSDOMBinding.h:357 > +struct VariadicHelperResult {
Would something simpler work? E.g. struct Result { size_t argumentIndex; Optional<Container> arguments; } Also, could we declare this struct inside the VariadicHelper struct?
> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:-1107 > -
In the future, please try to avoid this kind of unrelated spacing changes.
Chris Dumez
Comment 3
2016-09-09 09:13:14 PDT
Comment on
attachment 288400
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=288400&action=review
> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:3993 > + $value = "WTFMove($name.arguments.value())";
Why is this change needed? wouldn't this work? $value = "WTFMove(*$name.arguments)";
Nael Ouedraogo
Comment 4
2016-09-13 01:52:21 PDT
Created
attachment 288681
[details]
Patch
Nael Ouedraogo
Comment 5
2016-09-13 01:56:40 PDT
Thanks for the review.
> > Source/WebCore/bindings/js/JSDOMBinding.h:357 > > +struct VariadicHelperResult { > > Would something simpler work? E.g. > > struct Result { > size_t argumentIndex; > Optional<Container> arguments; > } > > Also, could we declare this struct inside the VariadicHelper struct?
Ok, done in the uploaded patch.
> > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:-1107 > > - > > In the future, please try to avoid this kind of unrelated spacing changes.
Ok, I thought it was good to remove trailing whitespaces.
> > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:3993 > > + $value = "WTFMove($name.arguments.value())"; > > Why is this change needed? wouldn't this work? > $value = "WTFMove(*$name.arguments)";
Yes, it works also but it seems that value() is generally used in WebKit instead of * with Optional value (c.f.
Bug 158835
#c14).
WebKit Commit Bot
Comment 6
2016-09-19 02:02:50 PDT
Comment on
attachment 288681
[details]
Patch Clearing flags on attachment: 288681 Committed
r206090
: <
http://trac.webkit.org/changeset/206090
>
WebKit Commit Bot
Comment 7
2016-09-19 02:02:54 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 8
2016-09-19 13:55:47 PDT
Comment on
attachment 288681
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=288681&action=review
> Source/WebCore/bindings/js/JSDOMBinding.h:363 > + Result(size_t argumentIndex, Optional<Container>&& arguments) > + : argumentIndex(argumentIndex) > + , arguments(WTFMove(arguments)) > + { > + }
We should not include this constructor. Member-wise initialization should accomplish the same thing.
Nael Ouedraogo
Comment 9
2016-09-20 11:55:21 PDT
(In reply to
comment #8
)
> Comment on
attachment 288681
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=288681&action=review
> > > Source/WebCore/bindings/js/JSDOMBinding.h:363 > > + Result(size_t argumentIndex, Optional<Container>&& arguments) > > + : argumentIndex(argumentIndex) > > + , arguments(WTFMove(arguments)) > > + { > > + } > > We should not include this constructor. Member-wise initialization should > accomplish the same thing.
Ok, I filed
bug 162298
for this.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug