Skip to content

Function to string does not comply with ECMAScript specification #5221

Open
@ayuan0828

Description

@ayuan0828

Description

When a user-defined function (not a built-in function) is converted to a string, the jerryscript engine returns a placeholder for '/* ecmascript */' instead of the actual function body string. This is inconsistent with the ECMAScript specification and mainstream engine behavior, and may have an impact on the relevant code.

Version

v3.0.0

Testcase

var functionArray = [
    function () {}
];
functionArray = functionArray + functionArray;
print(functionArray.length);

Output

64

Expected output

28

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions