Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d33bf8d

Browse files
committed
Fixed promise return (Promise.resolve is not a constructor)
1 parent 4f037ee commit d33bf8d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/plot_api/plot_api.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,11 +1647,11 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
16471647
if(typeof astr === 'string') aobj[astr] = val;
16481648
else if(Plotly.Lib.isPlainObject(astr)) {
16491649
aobj = astr;
1650-
if(traces===undefined) traces = val; // the 3-arg form
1650+
if(traces === undefined) traces = val; // the 3-arg form
16511651
}
16521652
else {
16531653
console.log('restyle fail',astr,val,traces);
1654-
return new Promise.reject();
1654+
return Promise.reject();
16551655
}
16561656

16571657
if(Object.keys(aobj).length) gd.changed = true;
@@ -2173,7 +2173,7 @@ Plotly.relayout = function relayout(gd, astr, val) {
21732173
gd = getGraphDiv(gd);
21742174

21752175
if(gd.framework && gd.framework.isPolar) {
2176-
return new Promise.resolve(gd);
2176+
return Promise.resolve(gd);
21772177
}
21782178

21792179
var layout = gd.layout,

0 commit comments

Comments
 (0)