From 96d501967373b5ddb2ebb05b32121b7812e165f0 Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Mon, 26 Feb 2024 12:07:03 -0500 Subject: [PATCH] improve amdefine and requirejs against an empty object --- tasks/test_amdefine.js | 2 +- tasks/test_requirejs.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/test_amdefine.js b/tasks/test_amdefine.js index 0da4ee86a93..7f343e7a775 100644 --- a/tasks/test_amdefine.js +++ b/tasks/test_amdefine.js @@ -16,7 +16,7 @@ if(typeof define !== 'function') { define(function(require) { var plotly = require('../dist/plotly.min.js'); - if(plotly) { + if(plotly && plotly.PlotSchema) { console.log(plotly); } else { throw 'Error: loading with amdefine'; diff --git a/tasks/test_requirejs.js b/tasks/test_requirejs.js index 4ec56da300e..a3a39494e89 100644 --- a/tasks/test_requirejs.js +++ b/tasks/test_requirejs.js @@ -18,7 +18,7 @@ requirejs.config({ requirejs(['plotly'], function(plotly) { - if(plotly) { + if(plotly && plotly.PlotSchema) { console.log(plotly); } else { throw 'Error: loading with requirejs';