From 7ee3abb987dc503086fefa0157cb8f0d33124181 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Thu, 22 Oct 2015 15:17:13 -0700 Subject: [PATCH] fix(keys): do not declare functions inside blocks fixes #194 --- lib/keys.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/keys.js b/lib/keys.js index a6276349b..c8eae95c9 100644 --- a/lib/keys.js +++ b/lib/keys.js @@ -2,12 +2,14 @@ * Creates keys for `private` properties on exposed objects to minimize interactions with other codebases. * The key will be a Symbol if the host supports it; otherwise a prefixed string. */ +var create; + if (typeof Symbol !== 'undefined') { - function create(name) { + create = function (name) { return Symbol(name); - } + } } else { - function create(name) { + create = function (name) { return '_zone$' + name; } } @@ -20,4 +22,4 @@ var commonKeys = { module.exports = { create: create, common: commonKeys -}; \ No newline at end of file +};