Prior to ES2015, function declarations within blocks were forbidden in strict mode (See MDN web docs):
(function() {
'use strict';
if (1) {
function x() {
// This results in "Strict mode does not allow function declarations in a
// lexically nested statement" or a similar error in some older browsers
}
}
})();
(Sorry, I didn't have the weapons to test this myself, just consulted the and trust my colleague's report.)
We ran into this issue when we saw some some buble-transformed code crash on iOS 9 Safari.
Would it be within Bublé's scope to transform this into equivalent code that works? E.g.:
(function() {
'use strict';
if (1) {
var x = function x() {
// Tada!
}
}
})();
Prior to ES2015, function declarations within blocks were forbidden in strict mode (See MDN web docs):
(Sorry, I didn't have the weapons to test this myself, just consulted the and trust my colleague's report.)
We ran into this issue when we saw some some buble-transformed code crash on iOS 9 Safari.
Would it be within Bublé's scope to transform this into equivalent code that works? E.g.: