Skip to content

hasOwnProperty throws an exception when the type of key is Symbol #573

@jacobbubu

Description

@jacobbubu
  • Version: v0.11.0
  • Platform: all
  • Subsystem:
var foo = Symbol("foo");
console.log({}.hasOwnProperty(foo));
TypeError: Cannot convert a Symbol value to a string.
    at undefined (/Users/rongshen/tmp/babel-pack/src/index.js:1:1)
    at undefined (/Users/rongshen/github/ShadowNode/src/js/module.js.wrapped:275:36)
    at undefined (/Users/rongshen/github/ShadowNode/src/js/module.js.wrapped:218:23)
    at undefined (/Users/rongshen/github/ShadowNode/src/js/module.js.wrapped:311:26)
    at undefined (/Users/rongshen/github/ShadowNode/src/js/iotjs.js.wrapped:18:2)
    at undefined (/Users/rongshen/github/ShadowNode/src/js/iotjs.js.wrapped:1:1)

That woks in Node.JS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions