Skip to content

allowProtoMethods/Properties runtime options do not work for nested objects #1858

@vassudanagunta

Description

@vassudanagunta

For example, given the following input:

function TestClass() {}
TestClass.prototype.aMethod = function() {
    return 'returnValue'
};
TestClass.prototype.nested = new TestClass()
const context = new TestClass()

the following,

const template = Handlebars.compile('{{nested.aMethod}}')
template(context, {allowProtoMethodsByDefault: true})

should yield 'returnValue'. Instead, it yields 'undefined'.

PR with failing test-cases submitted: #1859.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions