Skip to content

Alternative to with(obj||{}) #14

@dominictobias

Description

@dominictobias

Hi,

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with
"Using with is not recommended, and is forbidden in ECMAScript 5 strict mode."

I was wondering if there is a way to avoid using with as my closure compiler makes 270 verbose warnings about it and it fails in strict mode. Also the lookups needed make the execution slower.

Is there any 'automagic' way of appending the context variable to the references in the template or do you think the only way around this is to manually append a 'special' variable like ctx when referencing variables from the view in the template?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions