Skip to content

Commit 9cc3b99

Browse files
committed
fix: Uncommon issue at parseBindings appeared at Firefox
1 parent cd6818f commit 9cc3b99

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/parsebindings/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export default function parseBindings(object, givenNodes, eventOptions) {
7676

7777
const { outerHTML, innerHTML, childNodes, attributes } = node;
7878

79+
7980
// if outerHTML does't contain left bracket, then this node doesn't need to be parsed
8081
// we may need to check outerHTML existence for older browsers
8182
// we may need to add !~outerHTML.indexOf(encodeURI(leftBracket) to support old FF
@@ -85,7 +86,9 @@ export default function parseBindings(object, givenNodes, eventOptions) {
8586

8687
// initialize bindings for attributes if they appear
8788
if (attributes.length) {
88-
nofn.forEach(attributes, (attribute) => {
89+
// fixes Firefox issue: attributes.length can be changed by processAttribute
90+
const attrs = attributes.length > 1 ? [...attributes] : attributes;
91+
nofn.forEach(attrs, (attribute) => {
8992
if (bindingReg.test(attribute.value)) {
9093
processAttribute({
9194
node,

0 commit comments

Comments
 (0)