use Iterator instead of forEach (for performance optimization)
This commit is contained in:
parent
59444c68a6
commit
d02eb93c8a
@ -952,12 +952,10 @@ var TreeStyleTabUtils = {
|
|||||||
|
|
||||||
var event = document.createEvent('DataContainerEvent');
|
var event = document.createEvent('DataContainerEvent');
|
||||||
event.initEvent(type, canBubble, cancellable);
|
event.initEvent(type, canBubble, cancellable);
|
||||||
for (let i in data)
|
for (let [property, value] in Iterator(data))
|
||||||
{
|
{
|
||||||
if (!data.hasOwnProperty(i))
|
event.setData(property, value);
|
||||||
continue;
|
event[property] = value; // for backward compatibility
|
||||||
event.setData(i, data[i]);
|
|
||||||
event[i] = data[i]; // for backward compatibility
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return target.dispatchEvent(event);
|
return target.dispatchEvent(event);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user