+ if (
+ !(() => {
+ // Test whether this object has the node prototype in its
+ // prototype chain.
+ for (
+ let prototype = this === Object(this)
+ ? Object.getPrototypeOf(this)
+ : null;
+ prototype != null;
+ prototype = Object.getPrototypeOf(prototype)
+ ) {
+ if (prototype === nodePrototype) {
+ // This object inherits from the Node prototype.
+ return true;
+ } else {
+ // This object is not yet known to inherits from the Node
+ // prototype.
+ continue;
+ }
+ }
+ })()
+ ) {