diff --git a/src/core/component.js b/src/core/component.js index a8c9f5fe..6e525225 100644 --- a/src/core/component.js +++ b/src/core/component.js @@ -243,10 +243,14 @@ class Component { if (this.name === 'Component') { return this._requirements; } else if (this.hasOwnProperty('_requirements')) { - let deeper = this.requirements.call(this.__proto__); + let proto = Object.getPrototypeOf(this); + let deeper = this.requirements.call(proto); + //let deeper = Object.getPrototypeOf(this).requirements(); return Object.assign({}, deeper, this._requirements); } else { - let deeper = this.requirements.call(this.__proto__); + let proto = Object.getPrototypeOf(this); + let deeper = this.requirements.call(proto); + //let deeper = Object.getPrototypeOf(this).requirements(); return deeper; } } @@ -257,7 +261,10 @@ class Component { } else if (!this.className) { return false; } else { - return this.instanceOf.call(this.__proto__, className); + let proto = Object.getPrototypeOf(this); + let isInstance = this.instanceOf.call(proto, className); + //let isInstance = Object.getPrototypeOf(this).instanceOf(className); + return isInstance; } } /* diff --git a/src/nunjucks-env.js b/src/nunjucks-env.js index dc5c9234..44725465 100644 --- a/src/nunjucks-env.js +++ b/src/nunjucks-env.js @@ -1,6 +1,10 @@ const _ = require('lodash'); module.exports = function(env) { + // this is required for webpack when Environment is external and opts cannot be set with { autoescape: false } + env.opts.autoescape = false; + + // add Filteers for Environment env.addFilter('filter2', function(arr, path, value) { return arr.filter((x) => _.get(x, path)===value); });