refactor: remove toplevel property accesses (#29329)

PR Close #29329
This commit is contained in:
Filipe Silva
2019-05-02 16:44:24 +01:00
committed by Jason Aden
parent 739e5a4f53
commit ac34a1429b
32 changed files with 231 additions and 253 deletions

View File

@ -63,13 +63,15 @@ const _chromeNumKeyPadMap = {
'\x90': 'NumLock'
};
let nodeContains: (a: any, b: any) => boolean;
const nodeContains: (a: any, b: any) => boolean = (() => {
if (global['Node']) {
return global['Node'].prototype.contains || function(node: any) {
return !!(this.compareDocumentPosition(node) & 16);
};
}
if (global['Node']) {
nodeContains = global['Node'].prototype.contains || function(node) {
return !!(this.compareDocumentPosition(node) & 16);
};
}
return undefined as any;
})();
/**
* A `DomAdapter` powered by full browser DOM APIs.