WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.53k stars 4.21k forks source link

iAPI: Don't error when `data-wp-each` gets `undefined` #67174

Open luisherranz opened 1 day ago

luisherranz commented 1 day ago

Description

If data-wp-each gets a undefined it just throws.

Instead of that, it should subscribe to the property and treat it as an empty array until it not longer undefined.

Step-by-step reproduction instructions

Just use data-wp-each with a non-existing value:

<template data-wp-each="context.nonExistingValue">