зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1396856: Part 1 - Remove spread call fallback overhead in event dispatch. r=zombie
MozReview-Commit-ID: 3c5p9OvRqHI --HG-- extra : rebase_source : e145380ace787bab683808ef3894652bb1baee8d
This commit is contained in:
Родитель
06f76edc17
Коммит
9cf6734391
|
@ -1566,13 +1566,13 @@ EventManager.prototype = {
|
|||
let fire = {
|
||||
sync: (...args) => {
|
||||
if (shouldFire()) {
|
||||
return this.context.runSafe(callback, ...args);
|
||||
return this.context.applySafe(callback, args);
|
||||
}
|
||||
},
|
||||
async: (...args) => {
|
||||
return Promise.resolve().then(() => {
|
||||
if (shouldFire()) {
|
||||
return this.context.runSafe(callback, ...args);
|
||||
return this.context.applySafe(callback, args);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -1580,12 +1580,12 @@ EventManager.prototype = {
|
|||
if (!shouldFire()) {
|
||||
throw new Error("Called raw() on unloaded/inactive context");
|
||||
}
|
||||
return callback(...args);
|
||||
return Reflect.apply(callback, null, args);
|
||||
},
|
||||
asyncWithoutClone: (...args) => {
|
||||
return Promise.resolve().then(() => {
|
||||
if (shouldFire()) {
|
||||
return this.context.runSafeWithoutClone(callback, ...args);
|
||||
return this.context.applySafeWithoutClone(callback, args);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -416,10 +416,10 @@ class ProxyContextParent extends BaseContext {
|
|||
return this.sandbox;
|
||||
}
|
||||
|
||||
runSafe(...args) {
|
||||
applySafe(callback, args) {
|
||||
// There's no need to clone when calling listeners for a proxied
|
||||
// context.
|
||||
return this.runSafeWithoutClone(...args);
|
||||
return this.applySafeWithoutClone(callback, args);
|
||||
}
|
||||
|
||||
get xulBrowser() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче