The non-reentrant closure optimization patch added a check to CheckNewScriptProperties to bail on nested functions: https://hg.mozilla.org/mozilla-central/rev/d9650bc4da1a#l12.394 when this optimization was removed in bug 765956, this check was removed. However, this caused regressions (bug 773929). The quick fix was to go back to disallowing this function on nested functions (now using script->enclosingStaticScope), but it would be really good to understand why this restriction is necessary in the first place.
I tracked it down to bug 783396. Indeed, the nested functions were a red herring and only served to turn off the new-script analysis on the particular YouTube script in question.