Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Literal args comma fix #1577

Merged
merged 14 commits into from
May 22, 2015
Merged

Literal args comma fix #1577

merged 14 commits into from
May 22, 2015

Conversation

sjmiles
Copy link
Contributor

@sjmiles sjmiles commented May 20, 2015

No description provided.

Scott J Miles added 9 commits May 20, 2015 15:58
…te space from arguments, support literal arguments described as JSON
… contain at least one push dependency at this time)
* detect when an annotated computation has only literal arguments, flag it a `static` effect

* when adding a static effect, add it only to the effect list for the __static__ pseudo-property

* expose _executeStaticEffects method to process static effects on demand
…al arguments must now be either String or Number

* support using escaped-commas in literal-string arguments: `compute("foo\,bar", zot, 3)`
* support other character escaping which is naturally broken by HTML parser `compute('foo\'bar')`
* test for literal argument _before_ looking for structured args

_parseArg: function(rawArg) {
// clean up whitespace
var arg = String(rawArg).trim()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like rawArg is guaranteed to be a string (comes from split)... seems safe to just do rawArg.trim(). ...

@miztroh-zz
Copy link

@sjmiles @kevinpschaaf

From my tests, I'm still having issues with computed expressions that have only literal arguments. In the example below, node.foobar returns undefined. If I change one of the params to a property, it works just fine.

foobar: {
   computed: "computeFooBar('foo', 'bar')"
}
computeFooBar(foo, bar) {
   return foo + ' ' + bar;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants