(order, ch, sticky)
| 1675 | |
| 1676 | var bidiOther = null |
| 1677 | function getBidiPartAt(order, ch, sticky) { |
| 1678 | var found |
| 1679 | bidiOther = null |
| 1680 | for (var i = 0; i < order.length; ++i) { |
| 1681 | var cur = order[i] |
| 1682 | if (cur.from < ch && cur.to > ch) { |
| 1683 | return i |
| 1684 | } |
| 1685 | if (cur.to == ch) { |
| 1686 | if (cur.from != cur.to && sticky == "before") { |
| 1687 | found = i |
| 1688 | } else { |
| 1689 | bidiOther = i |
| 1690 | } |
| 1691 | } |
| 1692 | if (cur.from == ch) { |
| 1693 | if (cur.from != cur.to && sticky != "before") { |
| 1694 | found = i |
| 1695 | } else { |
| 1696 | bidiOther = i |
| 1697 | } |
| 1698 | } |
| 1699 | } |
| 1700 | return found != null ? found : bidiOther |
| 1701 | } |
| 1702 | |
| 1703 | // Bidirectional ordering algorithm |
| 1704 | // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm |
no outgoing calls
no test coverage detected