Skip to content

Variables from actions not hoisted #10

Description

@retorquere

I have a snippet like

/ name:[\.a-zA-Z]+ flag:flag? params:mparams? {
  name = name.join('')
  if Formatter['=#{name}']
    params = (params or []).join(',')
    return "this['=#{name}'](#{params})"
  else
    caseName = name.charAt(0).toLowerCase() + name.slice(1)
    return "this.stripHTML(this.item['#{name}'] || this.item['#{caseName}'] || '')"
  }

This generates javascript code that re-declares "name" and thereby blanks out the value passed in from the match (it used to work before porting it to coffeescript)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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