I have been building a SPA with breeze and WebAPI (starting with John Papa's sample) for a couple of months. A couple of days ago on my Windows 8 VS2012 internal IE browser started giving me javascript errors in breeze.debug.js.
JavaScript critical error at line 4663, column 13 in //http://localhost:50033/Script/breeze.debug.js
SCRIPT1028: Expected identifier, string or number
I went back to my other development machine, Windows 7 with VS2012 and it does not give the error. The code between the two machines is identical. I use Azure TFS to sync the code.
The error occurs at the closing });
function convertFromODataEntityType(odataEntityType, schema, metadataStore, serviceName) {
var shortName = odataEntityType.name;
var namespace = translateNamespace(schema, schema.namespace);
var entityType = new EntityType({
shortName: shortName,
namespace: namespace,
}); <==== line 4663
When I remove the comma after namespace, the error goes away but errors out again in another spot on line 6911.
day: { fn: function(source) { return source.day;}, dataType: "Number" },
month: { fn: function(source) { return source.month; }, dataType: "Number" },
year: { fn: function(source) { return source.year; }, dataType: "Number"},
}; <========= line 6911
Remove the comma on the line above and it errors out on line 1271
Unhandled exception at line 1271, column 17 in http://localhost:50033/Scripts/breeze.debug.js
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'some'
at this code:
function compile(self) {
if (!self._compiledFn) {
// clear off last one if null
if (self._fns[self._fns.length - 1] == null) {
self._fns.pop();
}
if (self._fns.length === 0) {
return undefined;
}
self._compiledFn = function (that, v) {
return that._fns.some(function (fn) {
return fn(that, v);
});
};
};
return self._compiledFn;
}
Has anyone else seen this behavior?