Skip to content

Commit 5500120

Browse files
committed
forEach -> for
1 parent 9948af4 commit 5500120

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/plot_api/plot_api.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,15 +400,19 @@ function setPlotContext(gd, config) {
400400
if(!gd._context) gd._context = Lib.extendFlat({}, Plotly.defaultConfig);
401401
var context = gd._context;
402402

403+
var i, keys, key;
404+
403405
if(config) {
404-
Object.keys(config).forEach(function(key) {
406+
keys = Object.keys(config);
407+
for(i = 0; i < keys.length; i++) {
408+
key = keys[i];
405409
if(key in context) {
406410
if(key === 'setBackground' && config[key] === 'opaque') {
407411
context[key] = opaqueSetBackground;
408412
}
409413
else context[key] = config[key];
410414
}
411-
});
415+
}
412416

413417
// map plot3dPixelRatio to plotGlPixelRatio for backward compatibility
414418
if(config.plot3dPixelRatio && !context.plotGlPixelRatio) {

0 commit comments

Comments
 (0)