Skip to content

Commit

Permalink
Update container.js
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanpenner authored Jun 2, 2017
1 parent a7f9afc commit 56c8fb1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/container/lib/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,10 @@ function wrapManagerInDeprecationProxy(manager) {
if (HAS_NATIVE_PROXY) {
let validator = {
get(obj, prop) {
// make work with node's formatValue
if (!(prop in obj)) { return ; }
if (prop === 'toString') {
return obj.toString.bind(obj);
}
// now works with nodes' formatValue

if (prop !== 'class' && prop !== 'create') {
if (typeof prop === 'symbol') { return obj[prop]; }
if (prop === 'inspect') { return undefined; /* for nodes formatter */ }

if (prop !== 'class' && prop !== 'create' && prop !== 'toString') {
throw new Error(`You attempted to access "${prop}" on a factory manager created by container#factoryFor. "${prop}" is not a member of a factory manager."`);
}

Expand Down

0 comments on commit 56c8fb1

Please sign in to comment.