Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upShorthand method definition fails to serialize and eval property #24
Comments
|
For easier testing, here's a RunKit that reproduces the issue: https://runkit.com/embed/03r03xdac3gn |
|
@wwwslinger is this failing in newer versions of node? |
|
@caridy The RunKit I linked is running Node v6.11.2, and I can also locally repro it on Node 8. I believe the issue is unrelated to the version of Node being used, but am not 100% certain. |
*properly
When using shorthand to define a function as a method in an object literal, serialization assigns a named function expression, which fails to evaluate.
Validate the functions first:
Do the serialization:
Note how it has created a
"fn3"entry as a named function, but has neglected to add thefunctionkeyword.Now try to
eval:All it needs to do is add the
functionkeyword:Node version: