Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Commit

Permalink
Fix NodeJS 4
Browse files Browse the repository at this point in the history
  • Loading branch information
moeriki committed Oct 9, 2017
1 parent 9d9c161 commit 9438caf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function depinFactory() {
*/
apply(func) {
const dependencies = fnArgs(func);
return func(...dependencies.map(depin.get));
return func.apply(depin, dependencies.map(depin.get));
},

/**
Expand All @@ -51,7 +51,8 @@ function depinFactory() {
* @param {...*} [dependencies]
* @return {object} app
*/
register(...args) {
register() {
const args = Array.from(arguments); // eslint-disable-line prefer-rest-params
let dependencies, factory, name;

if (typeof args[0] === 'function') {
Expand All @@ -75,7 +76,7 @@ function depinFactory() {

Object.defineProperty(container, name, {
get() {
return factory(...dependencies.map(depin.get));
return factory.apply(depin, dependencies.map(depin.get));
},
});

Expand Down

0 comments on commit 9438caf

Please sign in to comment.