Expose the size of the enum items in the webidl
Categories
(Core :: DOM: Bindings (WebIDL), enhancement, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox72 | --- | fixed |
People
(Reporter: chunmin, Assigned: bzbarsky)
References
Details
Attachments
(1 file)
Sometime we would like to know the number of the enum items in the webidl. For now we can only use EndGuard_ or ArrayLength(*Values::strings)to get this value. It would be good if this value can be defined in the binding header.
For example, to know the number of items in num CacheStorageNamespace, we would use CacheStorageNamespace::EndGuard_ or ArrayLength(CacheStorageNamespaceValues::strings)
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 1•6 years ago
|
||
or ArrayLength(*Values::strings)
And that doesn't even give the right answer (it's 1 too big)...
| Assignee | ||
Comment 2•6 years ago
|
||
Comment 4•6 years ago
|
||
Backed out changeset f9a4c8d67be3 (Bug 1582892) for build bustage at build/src/dom/console/ConsoleInstance.
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=272512767&repo=autoland&lineNumber=33539
[task 2019-10-23T03:13:31.565Z] 03:13:31 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/dom/serviceworkers/test/gtest'
[task 2019-10-23T03:13:31.566Z] 03:13:31 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/dom/serviceworkers/test/gtest'
[task 2019-10-23T03:13:31.567Z] 03:13:31 INFO - dom/serviceworkers/test/gtest/Unified_cpp_test_gtest0.o
[task 2019-10-23T03:13:31.568Z] 03:13:31 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/dom/serviceworkers/test/gtest'
[task 2019-10-23T03:13:33.074Z] 03:13:33 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/dom/console'
[task 2019-10-23T03:13:33.078Z] 03:13:33 INFO - /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang++ -m32 -o Unified_cpp_dom_console0.o -c -I/builds/worker/workspace/build/src/obj-firefox/dist/stl_wrappers -I/builds/worker/workspace/build/src/obj-firefox/dist/system_wrappers -include /builds/worker/workspace/build/src/config/gcc_hidden.h -DDEBUG=1 -DOS_POSIX=1 -DOS_LINUX=1 -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/builds/worker/workspace/build/src/dom/console -I/builds/worker/workspace/build/src/obj-firefox/dom/console -I/builds/worker/workspace/build/src/docshell/base -I/builds/worker/workspace/build/src/dom/base -I/builds/worker/workspace/build/src/js/xpconnect/src -I/builds/worker/workspace/build/src/obj-firefox/ipc/ipdl/_ipdlheaders -I/builds/worker/workspace/build/src/ipc/chromium/src -I/builds/worker/workspace/build/src/ipc/glue -I/builds/worker/workspace/build/src/obj-firefox/dist/include -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nspr -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /builds/worker/workspace/build/src/obj-firefox/mozilla-config.h -Qunused-arguments -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Qunused-arguments -Wall -Wbitfield-enum-conversion -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wc++1z-compat -Wc++2a-compat -Wcomma -Wimplicit-fallthrough -Werror=non-literal-null-conversion -Wstring-conversion -Wtautological-overlap-compare -Wtautological-unsigned-enum-zero-compare -Wtautological-unsigned-zero-compare -Wno-error=tautological-type-limit-compare -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=backend-plugin -Wno-error=return-std-move -Wno-error=atomic-alignment -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -Wno-unknown-warning-option -Wno-return-type-c-linkage -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -fno-aligned-new -fcrash-diagnostics-dir=/builds/worker/artifacts -march=pentium-m -msse -msse2 -mfpmath=sse -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -Xclang -load -Xclang /builds/worker/workspace/build/src/obj-firefox/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -Os -fno-omit-frame-pointer -funwind-tables -Werror -MD -MP -MF .deps/Unified_cpp_dom_console0.o.pp Unified_cpp_dom_console0.cpp
[task 2019-10-23T03:13:33.078Z] 03:13:33 INFO - In file included from Unified_cpp_dom_console0.cpp:11:
[task 2019-10-23T03:13:33.078Z] 03:13:33 ERROR - /builds/worker/workspace/build/src/dom/console/ConsoleInstance.cpp:59:20: error: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned int') [-Werror,-Wsign-compare]
[task 2019-10-23T03:13:33.078Z] 03:13:33 INFO - MOZ_ASSERT(index < ConsoleLogLevelValues::Count);
[task 2019-10-23T03:13:33.078Z] 03:13:33 INFO - ~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2019-10-23T03:13:33.078Z] 03:13:33 INFO - /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/Assertions.h:492:24: note: expanded from macro 'MOZ_ASSERT'
[task 2019-10-23T03:13:33.078Z] 03:13:33 INFO - ("MOZ_ASSERT", __VA_ARGS__))
[task 2019-10-23T03:13:33.078Z] 03:13:33 INFO - ^~~~~~~~~~~
[task 2019-10-23T03:13:33.078Z] 03:13:33 INFO - /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/Assertions.h:482:33: note: expanded from macro 'MOZ_ASSERT_GLUE'
[task 2019-10-23T03:13:33.078Z] 03:13:33 INFO - #define MOZ_ASSERT_GLUE(a, b) a b
[task 2019-10-23T03:13:33.080Z] 03:13:33 INFO - ^
[task 2019-10-23T03:13:33.080Z] 03:13:33 INFO - /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/Assertions.h:464:51: note: expanded from macro 'MOZ_ASSERT_HELPER1'
[task 2019-10-23T03:13:33.080Z] 03:13:33 INFO - if (MOZ_UNLIKELY(!MOZ_CHECK_ASSERT_ASSIGNMENT(expr))) { \
[task 2019-10-23T03:13:33.080Z] 03:13:33 INFO - ^~~~
[task 2019-10-23T03:13:33.081Z] 03:13:33 INFO - /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/StaticAnalysisFunctions.h:61:73: note: expanded from macro 'MOZ_CHECK_ASSERT_ASSIGNMENT'
[task 2019-10-23T03:13:33.081Z] 03:13:33 INFO - # define MOZ_CHECK_ASSERT_ASSIGNMENT(expr) MOZ_AssertAssignmentTest(!!(expr))
[task 2019-10-23T03:13:33.081Z] 03:13:33 INFO - ^~~~
[task 2019-10-23T03:13:33.081Z] 03:13:33 INFO - /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/Likely.h:17:48: note: expanded from macro 'MOZ_UNLIKELY'
[task 2019-10-23T03:13:33.081Z] 03:13:33 INFO - # define MOZ_UNLIKELY(x) (__builtin_expect(!!(x), 0))
[task 2019-10-23T03:13:33.081Z] 03:13:33 INFO - ^
[task 2019-10-23T03:13:33.082Z] 03:13:33 INFO - 1 error generated.
[task 2019-10-23T03:13:33.082Z] 03:13:33 INFO - /builds/worker/workspace/build/src/config/rules.mk:787: recipe for target 'Unified_cpp_dom_console0.o' failed
[task 2019-10-23T03:13:33.083Z] 03:13:33 ERROR - make[4]: *** [Unified_cpp_dom_console0.o] Error 1
[task 2019-10-23T03:13:33.083Z] 03:13:33 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/dom/console'
[task 2019-10-23T03:13:33.086Z] 03:13:33 INFO - /builds/worker/workspace/build/src/config/recurse.mk:74: recipe for target 'dom/console/target-objects' failed
[task 2019-10-23T03:13:33.086Z] 03:13:33 ERROR - make[3]: *** [dom/console/target-objects] Error 2
[task 2019-10-23T03:13:33.086Z] 03:13:33 INFO - make[3]: *** Waiting for unfinished jobs....
[task 2019-10-23T03:13:33.086Z] 03:13:33 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/dom/serviceworkers'
[task 2019-10-23T03:13:33.086Z] 03:13:33 INFO - dom/serviceworkers/Unified_cpp_dom_serviceworkers1.o
[task 2019-10-23T03:13:33.086Z] 03:13:33 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/dom/serviceworkers'
[task 2019-10-23T03:13:34.121Z] 03:13:34 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/dom/xslt/xslt'
| Assignee | ||
Comment 5•6 years ago
|
||
Gah, warnings as errors and different platforms...
| Assignee | ||
Updated•6 years ago
|
Comment 7•6 years ago
|
||
| bugherder | ||
Description
•