Repository navigation
Check inherited interfaces exist - #10240
lukebjerring merged 2 commits into
Conversation
|
#9853 is an example of test output which, before this change, wasn't obvious which missing interface caused the problem. |
Build PASSEDStarted: 2018-03-29 17:57:53 View more information about this build on: |
foolip
left a comment
There was a problem hiding this comment.
More tests for idlharness.js, yay! LGTM % nit.
| this["includes"] = {}; | ||
|
|
||
| // Assert B defined for A : B | ||
| for (var member of Array.from(Object.values(this.members)).filter(m => m.base)) { |
There was a problem hiding this comment.
Object.values already returns a vanilla Array, so the Array.from ought not be needed.
| } | ||
| if (e.message !== error) { | ||
| throw new IdlHarnessError(`${idlArrayFunc} threw ${e}, not the expected IdlHarnessError`); | ||
| throw new IdlHarnessError(`${idlArrayFunc} threw "${e}", not the expected IdlHarnessError "${error}"`); |
There was a problem hiding this comment.
Can you mention this drive-by fixing in the commit message when merging? Changes themselves look good!
|
Some breakage from this reported in https://bugs.chromium.org/p/chromium/issues/detail?id=827367 |
|
Since reverting this won't break anything and a fix would require review, I'll go ahead and revert. This would be the "Breakage in browser repos like Chromium which import wpt" case in #9953. |
This has broken idlharness.js tests with dictionary inheritance: https://bugs.chromium.org/p/chromium/issues/detail?id=827367 This reverts commit 3adbaa2.
|
+1 to revert. FWIW, I did some testing with a local fix: if (!(lhs in this.members)) throw new IdlHarnessError(`${lhs} inherits ${rhs}, but ${lhs} is undefined.`);
- if (!(this.members[lhs] instanceof IdlInterface)) throw new IdlHarnessError(`${lhs} inherits ${rhs}, but ${lhs} is not an interface.`);
if (!(rhs in this.members)) throw new IdlHarnessError(`${lhs} inherits ${rhs}, but ${rhs} is undefined.`);
- if (!(this.members[rhs] instanceof IdlInterface)) throw new IdlHarnessError(`${lhs} inherits ${rhs}, but ${rhs} is not an interface.`);
+ let lhs_is_interface = this.members[lhs] instanceof IdlInterface;
+ let rhs_is_interface = this.members[rhs] instanceof IdlInterface;
+ if (rhs_is_interface != lhs_is_interface) {
+ if (!lhs_is_interface) throw new IdlHarnessError(`${lhs} inherits ${rhs}, but ${lhs} is not an interface.`);
+ if (!rhs_is_interface) throw new IdlHarnessError(`${lhs} inherits ${rhs}, but ${rhs} is not an interface.`);
+ }... and there are a handful of interface tests that do have LHS with an undefined RHS (e.g. object "GamepadEventInit inherits EventInit, but EventInit is undefined.") so when a corrected version relands we will still see some real failures. (Which is a good thing!) |
|
Landing this change in Chromium and exporting might be easier, tells us right away which tests will be affected. |
|
I'll take the local fix and go via Chromium. P.S. didn't know github supported diffs. Cool. |
Ensures that
Bexists if youadd_[untested_]idl('interface A : B {};')See https://www.w3.org/TR/WebIDL-1/#idl-interfaces for definition of interface inheritance.
Fixes #10214
Note:
Side-stepping the
Cannot read property 'has_extended_attribute' of undefinedmessage at its source would involve non-null checks in several places (e.g. l1318, l1524, ...).This change is consistent with the other early existence checks, and is a fail-fast (before testing each member), which is likely to change the number of executed tests for any IDL tests which have undefined inherits.
This change is