From 56c8fb10d54d1531521e44ab1d0bde92739bd7e0 Mon Sep 17 00:00:00 2001 From: Stefan Penner Date: Fri, 2 Jun 2017 10:04:49 -0700 Subject: [PATCH] Update container.js --- packages/container/lib/container.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/container/lib/container.js b/packages/container/lib/container.js index c6398ae44cf..f37b2363006 100644 --- a/packages/container/lib/container.js +++ b/packages/container/lib/container.js @@ -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."`); }