RESOLVED CONFIGURATION CHANGED 38369
Remove custom bindings code for generating arrays
https://bugs.webkit.org/show_bug.cgi?id=38369
Summary Remove custom bindings code for generating arrays
Adam Barth
Reported 2010-04-29 19:51:11 PDT
Remove custom bindings code for generating arrays
Attachments
Work in progress (35.44 KB, patch)
2010-04-29 19:52 PDT, Adam Barth
no flags
Adam Barth
Comment 1 2010-04-29 19:52:07 PDT
Created attachment 54774 [details] Work in progress
Yaar Schnitman
Comment 2 2010-04-29 22:51:58 PDT
This is good stuff! Instead of [ArrayType=T] array, consider conforming to the Web IDL definitions: 1. sequence<T> 2. XxxArray I think the former is for light-weight generic JS [] arrays, while the later is for object that act like arrays but have their own prototype (e.g. WebGLFloatArray). Bot notations make the code simpler, as you don't have to carry the ext attrs along with the type string everywhere since T is embedded in the type string and easy to extract anywhere.
Adam Barth
Comment 3 2010-04-29 23:40:38 PDT
Oh, I'd much rather use WebIDL if they have this concept already. Do you have a pointer to some examples? The ones I was doing in this patch we real, honest JS arrays. The patch I attached was somewhat of a slash-and-burn prototype to show that it could be done, especially with mixing generated code with templates. I need to go redo it carefully. The ArrayType thing is needed only to get the includes right. I was hoping I could get away without it, but I don't see how to generate the proper includes without some sort of hint in the IDL.
Yaar Schnitman
Comment 4 2010-04-30 10:14:19 PDT
Here is one use example: http://bondi.omtp.org/1.01/apis/webidl.html Web IDL (who's editor is Sam Weining I think) has the sequence<T> definition commented out, but I don't know why: http://www.w3.org/TR/WebIDL/#idl-sequence Either go with sequence<T> or TArray. For sequence<T>, you'll need to tweak IDLParser.pm a bit (see below). For TArray, you might break bindings that already use types with Array suffixes. Once Web IDL reach decision, it would not be hard to substitute one with the other. +++ b/WebCore/bindings/scripts/IDLStructure.pm # Magic IDL parsing regular expressions -my $supportedTypes = "((?:unsigned )?(?:int|short|(?:long )?long)|(?:$idlIdNs*))"; +my $supportedTypes = "((?:unsigned )?(?:int|short|(?:long )?long)|(?:sequence<$idlIdNs*>|$idlIdNs*))"; # Special IDL notations -$interfaceSelector = 'interface\s*((?:' . $extendedAttributeSyntax . ' )?)(' . $idlIdNs . '*)\s*(?::(\s*[^{]*))?{([a-zA-Z0-9_=\s(),;:\[\]]*)'; -$interfaceMethodSelector = '\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)\s*\(\s*([a-zA-Z0-9:\s,=\[\]]*)'; +$interfaceSelector = 'interface\s*((?:' . $extendedAttributeSyntax . ' )?)(' . $idlIdNs . '*)\s*(?::(\s*[^{]*))?{([a-zA-Z0-9_=\s(),;:\[\]<>]*)'; +$interfaceMethodSelector = '\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)\s*\(\s*([a-zA-Z0-9:\s,=\[\]<>]*) $interfaceParameterSelector = 'in\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)';
Antonio Gomes
Comment 5 2013-08-20 15:35:21 PDT
WONTFIX?
Ahmad Saleem
Comment 6 2022-09-03 04:38:32 PDT
rniwa@webkit.org - Is this needed anymore? Thanks!
Ryosuke Niwa
Comment 7 2022-09-03 11:32:22 PDT
We support sequence<T> now.
Note You need to log in before you can comment on or make changes to this bug.