Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
fix(keys): do not declare functions inside blocks
Browse files Browse the repository at this point in the history
fixes #194
  • Loading branch information
vicb committed Oct 23, 2015
1 parent 22dce10 commit d44d699
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -20,4 +22,4 @@ var commonKeys = {
module.exports = {
create: create,
common: commonKeys
};
};

0 comments on commit d44d699

Please sign in to comment.