Closed Bug 950728 Opened 11 years ago Closed 11 years ago

The WebIDL codegen throws a cryptic error when marking an interface which is a callback argument as not-wrappercached

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: ehsan.akhgari, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

(Whiteboard: [qa-])

Attachments

(2 files)

STR: Apply this patch and build:

diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf
index eac1e7e..da47f96 100644
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -702,6 +702,10 @@ DOMInterfaces = {
     'headerFile': 'nsIMediaList.h',
 },

+'MediaQueryList': {
+    'wrapperCache': False
+},
+
 'MediaSource': [{
     'resultNotAddRefed': [ 'sourceBuffers', 'activeSourceBuffers' ],
 },


 0:06.43 Traceback (most recent call last):
 0:06.43   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
 0:06.43     "__main__", fname, loader, pkg_name)
 0:06.43   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
 0:06.43     exec code in run_globals
 0:06.43   File "/Users/ehsan/moz/src/python/mozbuild/mozbuild/action/webidl.py", line 17, in <module>
 0:06.43     sys.exit(main(sys.argv[1:]))
 0:06.43   File "/Users/ehsan/moz/src/python/mozbuild/mozbuild/action/webidl.py", line 13, in main
 0:06.43     manager.generate_build_files()
 0:06.43   File "/Users/ehsan/moz/src/dom/bindings/mozwebidlcodegen/__init__.py", line 273, in generate_build_files
 0:06.43     written, deps = self._generate_build_files_for_webidl(filename)
 0:06.43   File "/Users/ehsan/moz/src/dom/bindings/mozwebidlcodegen/__init__.py", line 461, in _generate_build_files_for_webidl
 0:06.43     root = CGBindingRoot(self._config, binding_stem, filename)
 0:06.43   File "/Users/ehsan/moz/src/dom/bindings/Codegen.py", line 9632, in __init__
 0:06.43     for c in mainCallbacks)
 0:06.43   File "/Users/ehsan/moz/src/dom/bindings/Codegen.py", line 9632, in <genexpr>
 0:06.43     for c in mainCallbacks)
 0:06.43   File "/Users/ehsan/moz/src/dom/bindings/Codegen.py", line 10773, in __init__
 0:06.44     methods=[CallCallback(callback, descriptorProvider)])
 0:06.44   File "/Users/ehsan/moz/src/dom/bindings/Codegen.py", line 11087, in __init__
 0:06.44     descriptorProvider, needThisHandling=True)
 0:06.44   File "/Users/ehsan/moz/src/dom/bindings/Codegen.py", line 11061, in __init__
 0:06.44     needThisHandling, rethrowContentException)
 0:06.44   File "/Users/ehsan/moz/src/dom/bindings/Codegen.py", line 10861, in __init__
 0:06.44     self.body = self.getImpl()
 0:06.44   File "/Users/ehsan/moz/src/dom/bindings/Codegen.py", line 10868, in getImpl
 0:06.44     "convertArgs": self.getArgConversions(),
 0:06.44   File "/Users/ehsan/moz/src/dom/bindings/Codegen.py", line 10928, in getArgConversions
 0:06.44     in enumerate(self.originalSig[1])]
 0:06.44   File "/Users/ehsan/moz/src/dom/bindings/Codegen.py", line 10975, in getArgConversion
 0:06.45     'exceptionCode' : self.exceptionCode
 0:06.45   File "/Users/ehsan/moz/src/dom/bindings/Codegen.py", line 4531, in wrapForType
 0:06.45     False))[0]
 0:06.45   File "/Users/ehsan/moz/src/dom/bindings/Codegen.py", line 4339, in getWrapTemplateForType
 0:06.45     raise MethodNotNewObjectError(descriptor.interface.identifier.name)
 0:06.45 Codegen.MethodNotNewObjectError

Note that this doesn't even fail the build, the bindings are just not regenerated.
Bug 950736 covers the build not failing.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Whiteboard: [need review]
Comment on attachment 8348145 [details] [diff] [review]
Nicer error reporting when a callback argument is not wrappercached.

>+        except MethodNotNewObjectError, err:
s/,/ as/ in 2.6+ python, I think
Attachment #8348145 - Flags: review?(bugs) → review+
https://bugzilla.mozilla.org/show_bug.cgi?id=950728 with that change.
Flags: in-testsuite-
Whiteboard: [need review]
Target Milestone: --- → mozilla29
https://hg.mozilla.org/mozilla-central/rev/a6e63e3125a8
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [qa-]
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: