以下错误仅发生在IE8
...Works inChrome
并且Firefox
无法测试 IE9,因为我最近出于测试目的降级了。
对方法或属性访问的意外调用。
调用堆栈
标有\\Call的相关代码出现在此处
从 IE 调试器调试值...:
_frames = 对象/函数
回调 = 对象/函数
callbackTarget = 对象/函数
callbackArg = 未定义
ko.dependencyDetection = (function () {
var _frames = [];
return {
begin: function (callback) {
_frames.push({ callback: callback, distinctDependencies:[] });
},
end: function () {
_frames.pop();
},
registerDependency: function (subscribable) {
if (!ko.isSubscribable(subscribable))
throw new Error("Only subscribable things can act as dependencies");
if (_frames.length > 0) {
var topFrame = _frames[_frames.length - 1];
if (!topFrame || ko.utils.arrayIndexOf(topFrame.distinctDependencies, subscribable) >= 0)
return;
topFrame.distinctDependencies.push(subscribable);
topFrame.callback(subscribable);
}
},
ignore: function(callback, callbackTarget, callbackArgs) {
try {
_frames.push(null);
return callback.apply(callbackTarget, callbackArgs || []);
}
//Call occurs here
//Error occurs here since there isn't a catch and the try is failing.
finally {
_frames.pop();
}
}
};
})();
来自:
"notifySubscribers": function (valueToNotify, event) {
event = event || defaultEvent;
if (this._subscriptions[event]) {
//Call occurs here
ko.dependencyDetection.ignore(function() {
ko.utils.arrayForEach(this._subscriptions[event].slice(0), function (subscription) {
// In case a subscription was disposed during the arrayForEach cycle, check
// for isDisposed on each subscription before invoking its callback
if (subscription && (subscription.isDisposed !== true))
subscription.callback(valueToNotify);
});
}, this);
}
},
来自:
ko.observable = function (initialValue) {
var _latestValue = initialValue;
function observable() {
if (arguments.length > 0) {
// Write
// Ignore writes if the value hasn't changed
if ((!observable['equalityComparer']) || !observable['equalityComparer'](_latestValue, arguments[0])) {
observable.valueWillMutate();
_latestValue = arguments[0];
if (DEBUG) observable._latestValue = _latestValue;
observable.valueHasMutated();
}
return this; // Permits chained assignments
}
else {
// Read
ko.dependencyDetection.registerDependency(observable); // The caller only needs to be notified of changes if they did a "read" operation
return _latestValue;
}
}
if (DEBUG) observable._latestValue = _latestValue;
ko.subscribable.call(observable);
observable.peek = function() { return _latestValue };
//call occurs here
observable.valueHasMutated = function () { observable["notifySubscribers"](_latestValue); }
observable.valueWillMutate = function () { observable["notifySubscribers"](_latestValue, "beforeChange"); }
ko.utils.extend(observable, ko.observable['fn']);
ko.exportProperty(observable, 'peek', observable.peek);
ko.exportProperty(observable, "valueHasMutated", observable.valueHasMutated);
ko.exportProperty(observable, "valueWillMutate", observable.valueWillMutate);
return observable;
}
来自:
ko.observable = function (initialValue) {
var _latestValue = initialValue;
function observable() {
if (arguments.length > 0) {
// Write
// Ignore writes if the value hasn't changed
if ((!observable['equalityComparer']) || !observable['equalityComparer'](_latestValue, arguments[0])) {
observable.valueWillMutate();
_latestValue = arguments[0];
if (DEBUG) observable._latestValue = _latestValue;
//Call occurs here
observable.valueHasMutated();
}
return this; // Permits chained assignments
}
else {
// Read
ko.dependencyDetection.registerDependency(observable); // The caller only needs to be notified of changes if they did a "read" operation
return _latestValue;
}
}
if (DEBUG) observable._latestValue = _latestValue;
ko.subscribable.call(observable);
observable.peek = function() { return _latestValue };
observable.valueHasMutated = function () { observable["notifySubscribers"](_latestValue); }
observable.valueWillMutate = function () { observable["notifySubscribers"](_latestValue, "beforeChange"); }
ko.utils.extend(observable, ko.observable['fn']);
ko.exportProperty(observable, 'peek', observable.peek);
ko.exportProperty(observable, "valueHasMutated", observable.valueHasMutated);
ko.exportProperty(observable, "valueWillMutate", observable.valueWillMutate);
return observable;
}
来自:
self.fraudQueue(msg.d);
视图模型
function FraudQueueViewModel(runDate, analyst, fraudOid, runNumber, processed, parameter) {
var self = this;
self.fraudQueue = ko.observableArray();
\\...
味精
不能共享 truemsg.d
但被验证为有效JSON
and JS object
, and 是array
.
更新 1
错误似乎出现在msg.d
...的内部数组上,msg.d
其中包含 18 个内部arrays
的objects
,其中一些包含另一个内部的array
。