WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
69801
Regarding constructor, replace [ConstructorWith=...] IDL with [CallWith=...] IDL
https://bugs.webkit.org/show_bug.cgi?id=69801
Summary
Regarding constructor, replace [ConstructorWith=...] IDL with [CallWith=...] IDL
Kentaro Hara
Reported
2011-10-10 16:43:37 PDT
As for constructors, [ConstructorWith=...] has the same meaning as [CallWith=...]. We should deprecate [ConstructorWith=...]. This is a clean-up bug for the
bug 65839
.
Attachments
Patch
(5.02 KB, patch)
2011-10-13 05:35 PDT
,
Kentaro Hara
no flags
Details
Formatted Diff
Diff
Patch
(5.03 KB, patch)
2011-10-13 05:37 PDT
,
Kentaro Hara
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Adam Barth
Comment 1
2011-10-10 16:56:39 PDT
@Kentaro: CallWith should also be the first arguments to the constructors, not the last as ConstructorWith appears to be.
Kentaro Hara
Comment 2
2011-10-10 17:08:07 PDT
abarth: There are two options. Deprecate [ConstructorWith=...] or deprecate [CallWith=...]. I first thought that deprecating [ConstructorWith=...] will make more sense, since [CallWith=...] is used here and there and I did not care the position of arguments. I want to keep the position of arguments of existing constructors as it is (i.e. the last). So, as for constructors, I would like to deprecate [CallWith=...].
Adam Barth
Comment 3
2011-10-10 17:13:04 PDT
See also
Bug 69799
> I want to keep the position of arguments of existing constructors as it is
Why?
Kentaro Hara
Comment 4
2011-10-10 17:30:08 PDT
(In reply to
comment #3
)
> > I want to keep the position of arguments of existing constructors as it is > > Why?
Just because all the existing custom constructors that are using ScriptExecutionContext are putting it as the last argument.
> See also
Bug 69799
Ah, sorry, I noticed it now. I agree to it. Before uploading this patch, I will wait for the above patch landed.
Kentaro Hara
Comment 5
2011-10-13 05:35:37 PDT
Created
attachment 110832
[details]
Patch
Kentaro Hara
Comment 6
2011-10-13 05:37:37 PDT
Created
attachment 110833
[details]
Patch
Adam Barth
Comment 7
2011-10-13 11:34:48 PDT
Comment on
attachment 110833
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=110833&action=review
> Source/WebCore/ChangeLog:7 > + As for constructors, [ConstructorWith=...] has the same meaning as [CallWith=...]. > + We should deprecate [ConstructorWith=...]. This is a clean-up bug for the
bug 65839
.
It's somewhat less obvious what CallWith means as an attribute of the whole interface. I guess it makes sense for JavaScript where the interface *is* the constructor, but it probably makes somewhat less sense for other languages. I still think this patch is a win though.
> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:1549 > - if ($dataNode->extendedAttributes->{"ConstructorWith"} && $dataNode->extendedAttributes->{"ConstructorWith"} eq "ScriptExecutionContext") { > + if ($dataNode->extendedAttributes->{"CallWith"} && $dataNode->extendedAttributes->{"CallWith"} eq "ScriptExecutionContext") {
Do we not need a similar change to CodeGeneratorJSC.pm ? I guess all these interfaces have JSCustomConstructor.
> Source/WebCore/fileapi/FileReader.idl:-41 > - ConstructorWith=ScriptExecutionContext,
This doesn't need CallWith ? I guess not if we can compile without it.
Kentaro Hara
Comment 8
2011-10-13 15:37:40 PDT
(In reply to
comment #7
)
> (From update of
attachment 110833
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=110833&action=review
> > > Source/WebCore/ChangeLog:7 > > + As for constructors, [ConstructorWith=...] has the same meaning as [CallWith=...]. > > + We should deprecate [ConstructorWith=...]. This is a clean-up bug for the
bug 65839
. > > It's somewhat less obvious what CallWith means as an attribute of the whole interface. I guess it makes sense for JavaScript where the interface *is* the constructor, but it probably makes somewhat less sense for other languages. I still think this patch is a win though. > > > Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:1549 > > - if ($dataNode->extendedAttributes->{"ConstructorWith"} && $dataNode->extendedAttributes->{"ConstructorWith"} eq "ScriptExecutionContext") { > > + if ($dataNode->extendedAttributes->{"CallWith"} && $dataNode->extendedAttributes->{"CallWith"} eq "ScriptExecutionContext") { > > Do we not need a similar change to CodeGeneratorJSC.pm ? I guess all these interfaces have JSCustomConstructor.
No, because [ConstructorWith] is the IDL that I introduced when I implemented [Constructor] IDL for V8, in other words, [ConstructorWith] is not yet implemented in JSC.
> > > Source/WebCore/fileapi/FileReader.idl:-41 > > - ConstructorWith=ScriptExecutionContext, > > This doesn't need CallWith ? I guess not if we can compile without it.
It has CallWith. You can find it by clicking "20 below" link of FileReader.idl diff. I just removed ConstructorWith because FileReader.idl has both ConstructorWith and CallWith. Thanks for reviewing these patches, Adam!
WebKit Review Bot
Comment 9
2011-10-13 16:44:51 PDT
Comment on
attachment 110833
[details]
Patch Clearing flags on attachment: 110833 Committed
r97424
: <
http://trac.webkit.org/changeset/97424
>
WebKit Review Bot
Comment 10
2011-10-13 16:44:56 PDT
All reviewed patches have been landed. Closing bug.
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