I happened to come across the following weird case:
One of the network calls returned a response like this:
window.function1 = function() {
console.log('function 1');
} window.project = 'test';
But when the following script is getting evaluated, it is returning an error
Unexpected Identifier
This issue gets fixed when a semi-colon
is added after the function1 definition So the correct fix is:
window.function1 = function() {
console.log('function 1');
}; window.project = 'test';
I am curious to know the reason behind this.