mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1150247 - Check if value is function before binding. r=ato
Rather than attempting to bind non-functions and catching the exception this explicitly checks if it is a function. This helps reduce memory consumption needed for the exception stack traces. Realistically that will go away when GC is run, but it throws off memory measurments prior to that.
This commit is contained in:
parent
4c1d59941c
commit
34d7a9d2f5
@ -830,9 +830,9 @@ GeckoDriver.prototype.createExecuteSandbox = function(win, mn, sp) {
|
||||
sb.testUtils = utils;
|
||||
|
||||
mn.exports.forEach(function(fn) {
|
||||
try {
|
||||
if (typeof mn[fn] === 'function') {
|
||||
sb[fn] = mn[fn].bind(mn);
|
||||
} catch(e) {
|
||||
} else {
|
||||
sb[fn] = mn[fn];
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user