Skip to content

Commit

Permalink
Add note about performance vs correctness
Browse files Browse the repository at this point in the history
  • Loading branch information
TimvdLippe committed Mar 31, 2018
1 parent 8d97d13 commit 89ab738
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/mixins/property-effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -2629,6 +2629,17 @@
* - Inline computed method (supports negation):
* `[[compute(a, 'literal', b)]]`, `[[!compute(a, 'literal', b)]]`
*
* The default implementation uses a regular expression for best
* performance. However, the regular expression uses a white-list of
* allowed characters in a data-binding, which causes problems for
* data-bindings that do use characters not in this white-list.
*
* Instead of updating the white-list with all allowed characters,
* there is a StrictBindingParser (see lib/mixins/strict-binding-parser)
* that uses a state machine instead. This state machine is able to handle
* all characters. However, it is slightly less performant, therefore we
* extracted it into a separate optional mixin.
*
* @param {string} text Text to parse from attribute or textContent
* @param {Object} templateInfo Current template metadata
* @return {Array<!BindingPart>} Array of binding part metadata
Expand Down

0 comments on commit 89ab738

Please sign in to comment.