Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is not possible to use a Symbol as a property key on a service. #863

Closed
bertho-zero opened this issue May 1, 2018 · 3 comments
Closed

Comments

@bertho-zero
Copy link
Collaborator

Steps to reproduce

const feathers = require('@feathersjs/feathers');
const prop = Symbol('test-it');

const app = feathers()
  .use('users', {
    create() {},
    [prop]: 'ok'
  });

const service = app.service('users')
console.log(service[prop]); // undefined
// should be 'ok'

Expected behavior

It should be possible to recover a value with a Symbol key.

Actual behavior

The key disappears.

System configuration

Module versions (especially the part that's not working):
@feathersjs/feathers@^3.1.4

NodeJS version:
v8.11.1

Operating System:
Ubuntu 16.04

@daffl
Copy link
Member

daffl commented May 1, 2018

It's because Object.getOwnPropertyNames does not include symbols (which is happening at https://github.com/daffl/uberproto/blob/master/lib/proto.js#L81). It should now probably also include Object.getOwnPropertySymbols.

@daffl
Copy link
Member

daffl commented Jun 3, 2018

Closed via #880, daffl/uberproto#13 and #881

@daffl daffl closed this as completed Jun 3, 2018
@lock
Copy link

lock bot commented Feb 7, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue with a link to this issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Feb 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants