Skip to content

Node 10.0.0 Function 's toString method behaves differently than in previous versions #28

Description

@sadasant

Node 10.0.0 yields an unexpected result when functions are converted to strings through the toString method. Here's what happens:

  • 10.0.0: (function () { }).toString() results in: 'function () { }'.
  • 9.5.0: (function(){ }).toString() results in: 'function (){ }'.

The affected line is: https://github.com/nodegit/promisify-node/blob/master/utils/args.js#L9
A possible solution is to change the RegExp to: /function.*?\(([^)]*)\)/ (for example).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions