- If you pass too many arguments the extra ones are ignored. Try
document.getElementsByTagName("a", "b")
. If you pass too few, you get an exception:document.getElementsByTagName()
. - If you apply a WebIDL operation to the wrong type of object, you get an exception. See http://heycam.github.io/webidl/#es-operations step 4 under "Try running the following steps".
document.getElementsByTagName.call(document.body, "div")
for example. - Interface inheritance corresponds to a prototype chain as described at http://heycam.github.io/webidl/#interface-prototype-object but in brief if you have
interface Foo : Bar { };
thenObject.getPrototypeOf(Foo.prototype) === Bar.prototype
. So for example, the prototype ofHTMLElement.prototype
isElement.prototype
. - DOM objects with a stringifier defined (e.g.
HTMLAnchorElement
) are stringified however the relevant specification defines them to be. All other objects become "[object MostDerivedInterfaceName]".
Things that defined by WebIDL
-
11-10-2022 - |
質問
After reading this post, http://mcc.id.au/2013/lca-webidl/
I have some questions in the page 20,
What happens when you pass too many/few arguments.
What happens when you grab a Function corresponding to an IDL operation and apply it to some other type of object.
How interface inheritance corresponds to a prototype chain.
How DOM objects are stringified.
Can anyone give a specific explanation or example to these points.
Thanks
解決
所属していません StackOverflow