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:
@@ -211,11 +211,11 @@ function initMutationObserver(
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
for (var it = movedSet.values(), n = null; (n = it.next().value); ) {
|
for (const n of movedSet) {
|
||||||
pushAdd(n);
|
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)) {
|
if (!isAncestorInSet(droppedSet, n) && !isParentRemoved(removes, n)) {
|
||||||
pushAdd(n);
|
pushAdd(n);
|
||||||
} else if (isAncestorInSet(movedSet, n)) {
|
} else if (isAncestorInSet(movedSet, n)) {
|
||||||
@@ -281,7 +281,10 @@ function initMutationObserver(
|
|||||||
return observer;
|
return observer;
|
||||||
}
|
}
|
||||||
|
|
||||||
function initMoveObserver(cb: mousemoveCallBack, mousemoveWait: number): listenerHandler {
|
function initMoveObserver(
|
||||||
|
cb: mousemoveCallBack,
|
||||||
|
mousemoveWait: number,
|
||||||
|
): listenerHandler {
|
||||||
let positions: mousePosition[] = [];
|
let positions: mousePosition[] = [];
|
||||||
let timeBaseline: number | null;
|
let timeBaseline: number | null;
|
||||||
const wrappedCb = throttle((isTouch: boolean) => {
|
const wrappedCb = throttle((isTouch: boolean) => {
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "build",
|
"outDir": "build",
|
||||||
"lib": ["es6", "dom"]
|
"lib": ["es6", "dom"],
|
||||||
|
"downlevelIteration": true
|
||||||
},
|
},
|
||||||
"compileOnSave": true,
|
"compileOnSave": true,
|
||||||
"exclude": ["test"],
|
"exclude": ["test"],
|
||||||
|
|||||||
Reference in New Issue
Block a user