Angularjs throws “Unexpected strict mode reserved word” which causes application to crash #7969
Description
I am currently developing an application for mobile phones using angularJS and cordova 3.2.
Some of my players report, that the application is not starting on their devices. This devices are listed below.
- optimus p880 (Android Version 4.0.3)
- Lifetab von Medion (Adroid Version 4.0.3)
- Sony Ericsson Xperia mini pro ( Android 4.0.4)
So it seems somehow connected to that Android Version 4.0.3/4.
Not starting means, that the cordova application is starting, but that angularjs crashes before it is initiated, because all the elements where an ng-cloak
class is attached (which in my case is set for the complete root window) remain hidden. So the user does not see anything.
The problem is, that I don't have any of this devices to test it, but one player did send me the logs of his device, saying
Uncaught SyntaxError: Unexpected strict mode reserved word
With the line number and the file name I could determine, that the problem is caused by the code below (its from the angular.js v1.2.16 file in line 3878). The problem seems to apply in the statement throw err;
(#3878)
function createInternalInjector(cache, factory) {
function getService(serviceName) {
if (cache.hasOwnProperty(serviceName)) {
if (cache[serviceName] === INSTANTIATING) {
throw $injectorMinErr('cdep', 'Circular dependency found: {0}', path.join(' <- '));
}
return cache[serviceName];
} else {
try {
path.unshift(serviceName);
cache[serviceName] = INSTANTIATING;
return cache[serviceName] = factory(serviceName);
} catch (err) {
if (cache[serviceName] === INSTANTIATING) {
delete cache[serviceName];
}
throw err; /*** THE ERROR APPLIES HERE! **/
} finally {
path.shift();
}
}
}
I cannot really say, what happens here. The applications works fine on other devices and other android versions.
Has anyone of you an idea how I could fix that issue for the players?
(I duplicated this issue from StackOverflow. )