Skip to content

Wrong exception reported for throw with toString returning symbol #4912

Closed
@programmerjake

Description

@programmerjake

displaying wrong exception for throwing an object with toString returning a symbol:

> throw {toString:function(){return Symbol.iterator}}
TypeError: Cannot convert a Symbol value to a string
    at Domain.<anonymous> (repl.js:277:43)
    at emitOne (events.js:77:13)
    at Domain.emit (events.js:169:7)
    at REPLServer.defaultEval (repl.js:256:26)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
    at REPLServer.<anonymous> (repl.js:412:12)
    at emitOne (events.js:82:20)
    at REPLServer.emit (events.js:169:7)
    at REPLServer.Interface._onLine (readline.js:210:10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions