Skip to content

Commit

Permalink
[autoload] support 4.x defined autoload as an own prop
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Feb 3, 2016
1 parent 2510b30 commit a099523
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ var path = require('path');

module.exports = function (kibana) {
var mainFile = 'plugins/timelion/app';
if (Object.getOwnPropertyDescriptor(kibana.constructor.prototype, 'autoload').get) {

var ownDescriptor = Object.getOwnPropertyDescriptor(kibana, 'autoload');
var protoDescriptor = Object.getOwnPropertyDescriptor(kibana.constructor.prototype, 'autoload');
var descriptor = ownDescriptor || protoDescriptor || {};
if (descriptor.get) {
// the autoload list has been replaced with a getter that complains about
// improper access, bypass that getter by seeing if it is defined
mainFile = 'plugins/timelion/app_with_autoload';
Expand Down

0 comments on commit a099523

Please sign in to comment.