Enable the IDL attribute checker in Chromium
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 09:00:03 +0000 (09:00 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Feb 2012 09:00:03 +0000 (09:00 +0000)
commit75c6e6d1d5f9550c856e7820b8b92ff0f78f5e2a
treef46f9f9e649c31b3471d8f29821233468cc00b2d
parent65a17174edad3e55402875d4110f6cfaa3ec2d43
Enable the IDL attribute checker in Chromium
https://bugs.webkit.org/show_bug.cgi?id=79082

Reviewed by Adam Barth.

We have fixed 10~ bugs caused by typos of IDL attributes.
This patch adds an IDL attribute checker, which checks if all IDL attributes
used in IDL files are implemented by code generators.

    - The IDL attribute checker uses IDLAttributes.txt, which lists all
      IDL attributes implemented in code generators. If we want to add
      a new IDL attribute, we need to add it to IDLAttributes.txt manually.
    - The IDL attribute checker checks if all IDL attributes used in IDL files
      are listed in IDLAttributes.txt.
    - If the IDL attribute checker fails, the build fails with a verbose error message.

No tests. I manually checked that [Custommm], [CallWith=],
[CallWith=ScriptExecutionContext|Foo] cause build failures.

* WebCore.gyp/WebCore.gyp: Modified to enable the IDL attribute checker.

* bindings/scripts/resolve-supplemental.pl:
(loadIDLAttributes): This method loads a list of IDL attributes from IDLAttributes.txt.
(checkIDLAttributes): This method implementes the IDL attribute checker as described above.
(checkIfIDLAttributesExists):

* bindings/scripts/IDLParser.pm: "1" is not good to represent that
the IDL attribute does not have any value. This patch changed it to "VALUE_IS_MISSING".
(parseExtendedAttributes):
(ParseInterface):
* bindings/scripts/CodeGenerator.pm: Ditto.
(ContentAttributeName):
* bindings/scripts/CodeGeneratorV8.pm: Ditto.
(GenerateNormalAttrGetter):
(GenerateNormalAttrSetter):
(GenerateSingleBatchedAttribute):
(GetRuntimeEnableFunctionName):
* bindings/scripts/IDLAttributes.txt: Added. This file lists all IDL attributes implemented
in code generators.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108322 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gyp/WebCore.gyp
Source/WebCore/bindings/scripts/CodeGenerator.pm
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/scripts/IDLAttributes.txt [new file with mode: 0644]
Source/WebCore/bindings/scripts/IDLParser.pm
Source/WebCore/bindings/scripts/resolve-supplemental.pl