close #143 tweak the code of iterating iterators

Originally we use Array.from to transform iterator into array.
But we found some framework may overwrite the Array.from with a
pollyfill which was not implement correctly.
This commit is contained in:
Yanzhen Yu
2019-11-24 22:33:45 +08:00
parent 130e6b2c60
commit f30328e40c
2 changed files with 8 additions and 4 deletions

View File

@@ -211,11 +211,11 @@ function initMutationObserver(
});
};
for (var it = movedSet.values(), n = null; (n = it.next().value); ) {
for (const n of movedSet) {
pushAdd(n);
}
for (var it = addedSet.values(), n = null; (n = it.next().value); ) {
for (const n of addedSet) {
if (!isAncestorInSet(droppedSet, n) && !isParentRemoved(removes, n)) {
pushAdd(n);
} else if (isAncestorInSet(movedSet, n)) {
@@ -281,7 +281,10 @@ function initMutationObserver(
return observer;
}
function initMoveObserver(cb: mousemoveCallBack, mousemoveWait: number): listenerHandler {
function initMoveObserver(
cb: mousemoveCallBack,
mousemoveWait: number,
): listenerHandler {
let positions: mousePosition[] = [];
let timeBaseline: number | null;
const wrappedCb = throttle((isTouch: boolean) => {

View File

@@ -8,7 +8,8 @@
"sourceMap": true,
"rootDir": "src",
"outDir": "build",
"lib": ["es6", "dom"]
"lib": ["es6", "dom"],
"downlevelIteration": true
},
"compileOnSave": true,
"exclude": ["test"],