Bug 37998 - Improve code generator scripts to handle OR ('|') condition in the extended attributes
Summary: Improve code generator scripts to handle OR ('|') condition in the extended a...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Jian Li
URL:
Keywords:
Depends on:
Blocks: 37840
  Show dependency treegraph
 
Reported: 2010-04-22 10:58 PDT by Jian Li
Modified: 2010-04-27 14:22 PDT (History)
5 users (show)

See Also:


Attachments
Proposed Patch (11.81 KB, patch)
2010-04-22 11:31 PDT, Jian Li
abarth: review+
jianli: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jian Li 2010-04-22 10:58:18 PDT
The current code generator scripts support using AND ('&') condition in the extended attributes of an interface. We need to also add support for OR '|' condition, like in FileError interface case:
      interface [
          Conditional=FILE_READER|FILE_WRITER
      ] FileError {

In addition, the condition operator is not supported in the extended attributes of properties/methods of an interface. We need to fix this.
Comment 1 Jian Li 2010-04-22 11:31:59 PDT
Created attachment 54079 [details]
Proposed Patch
Comment 2 Adam Barth 2010-04-23 00:47:49 PDT
Comment on attachment 54079 [details]
Proposed Patch

WebCore/bindings/scripts/CodeGeneratorJS.pm:298
 +      } else {
Maybe it's better to be explicit here?  You're assuming that not & is |

Nice removal Of copy/paste code.  Please address the above before landing.
Comment 3 Jian Li 2010-04-23 15:25:33 PDT
Fixed and landed at http://trac.webkit.org/changeset/58193.
Comment 4 Adam Barth 2010-04-23 16:29:08 PDT
It occurs to me that you didn't add a test to our spiffy new generated code testing harness.  Can you please add one in a follow up bug?
Comment 5 Jian Li 2010-04-23 16:57:56 PDT
Where is it located? I will add one.
Comment 6 Adam Barth 2010-04-23 19:01:36 PDT
(In reply to comment #5)
> Where is it located? I will add one.

I'm not 100% sure.  Look for a file with the word "test" and idl in it's name.  I think there is a run-bindings-tests script somewhere too.  This is all very new.