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 45143
V8/JS bindings should not perform type checks if the parameter has Callback attribute
https://bugs.webkit.org/show_bug.cgi?id=45143
Summary
V8/JS bindings should not perform type checks if the parameter has Callback a...
Kinuko Yasuda
Reported
2010-09-02 15:49:14 PDT
It causes compile error if an overloaded function has callback parameters.
Attachments
Patch
(5.39 KB, patch)
2010-09-02 18:25 PDT
,
Kinuko Yasuda
no flags
Details
Formatted Diff
Diff
Patch
(8.24 KB, patch)
2010-09-02 22:32 PDT
,
Kinuko Yasuda
darin
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Kinuko Yasuda
Comment 1
2010-09-02 18:25:31 PDT
Created
attachment 66450
[details]
Patch
Dumitru Daniliuc
Comment 2
2010-09-02 20:01:56 PDT
Comment on
attachment 66450
[details]
Patch
> WebCore/bindings/scripts/CodeGeneratorJS.pm:1137 > + if ($codeGenerator->IsStringType($type)) {
i think it might be cleaner to format this code as: if (IsStringType($type)) { ... } elsif ($parameter->extendedAttributes->{"Callback"}) { ... } elsif (!IsNativeType($type)) { ... } same comment for CodeGeneratorV8.pm.
> WebCore/bindings/scripts/test/V8/V8TestObj.cpp:-981 > - if ((args.Length() == 2 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0])) && (args[1]->IsNull() || args[1]->IsUndefined() || args[1]->IsString() || args[1]->IsObject())))
i believe you need to change JS/JSTestObj.cpp too.
Kinuko Yasuda
Comment 3
2010-09-02 22:32:08 PDT
Created
attachment 66469
[details]
Patch
Kinuko Yasuda
Comment 4
2010-09-02 22:40:24 PDT
(In reply to
comment #2
)
> (From update of
attachment 66450
[details]
) > > WebCore/bindings/scripts/CodeGeneratorJS.pm:1137 > > + if ($codeGenerator->IsStringType($type)) { > i think it might be cleaner to format this code as: > > if (IsStringType($type)) { > ... > } elsif ($parameter->extendedAttributes->{"Callback"}) { > ... > } elsif (!IsNativeType($type)) { > ... > } > > same comment for CodeGeneratorV8.pm.
Fixed. Wasn't very sure if we want to check that for native types... but maybe it would contribute to readability.
> > WebCore/bindings/scripts/test/V8/V8TestObj.cpp:-981 > > - if ((args.Length() == 2 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0])) && (args[1]->IsNull() || args[1]->IsUndefined() || args[1]->IsString() || args[1]->IsObject()))) > i believe you need to change JS/JSTestObj.cpp too.
Fixed. (The update in the previous patch was an error actually - this time I added a new overloaded method with callback arg and updated both {V8,JS}TestObj.cpp.)
Dumitru Daniliuc
Comment 5
2010-09-03 03:40:03 PDT
Comment on
attachment 66469
[details]
Patch r=me.
Darin Adler
Comment 6
2010-09-03 09:59:39 PDT
Comment on
attachment 66469
[details]
Patch Why did this test go in without any actual JavaScript regression tests? Presumably this was done to change real-world behavior, not just to change the bindings source code in a way that is not visible from web pages. We don’t want bug fixes going in without regression tests. I don’t see any reason for this to be an exception!
Darin Adler
Comment 7
2010-09-03 10:00:04 PDT
Comment on
attachment 66469
[details]
Patch I’m going to change this to a review- until I find out why there are no regression tests.
Darin Adler
Comment 8
2010-09-03 10:00:33 PDT
Comment on
attachment 66469
[details]
Patch Oops, I see now. A compilation error. My bad. Adding back Dumi’s review+.
Kinuko Yasuda
Comment 9
2010-09-03 11:56:09 PDT
(In reply to
comment #8
)
> (From update of
attachment 66469
[details]
) > Oops, I see now. A compilation error. My bad. Adding back Dumi’s review+.
Thanks for examining this... ok to go now? Currently there's no such IDL that has overloaded function with callbacks (I was going to add one and got a compilation error). I'll double check that this doesn't change anything for existing IDLs.
Darin Adler
Comment 10
2010-09-03 14:17:13 PDT
(In reply to
comment #9
)
> Thanks for examining this... ok to go now?
I have no objection. I didn’t review the patch, but I see no reason to reverse Dumi’s review+ now that I understand.
Kinuko Yasuda
Comment 11
2010-09-03 21:25:36 PDT
Committed
r66791
: <
http://trac.webkit.org/changeset/66791
>
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