
ko.utils.domData = new (function () {
    var uniqueId = 0;
    var dataStoreKeyExpandoPropertyName = "__ko__" + (new Date).getTime();
    var dataStore = {};

    var getDataForNode, clear;
    if (!ko.utils.ieVersion) {
        getDataForNode = function (node, createIfNotFound) {
            var dataForNode = node[dataStoreKeyExpandoPropertyName];
            if (!dataForNode && createIfNotFound) {
                dataForNode = node[dataStoreKeyExpandoPropertyName] = {};
            }
            return dataForNode;
        };
        clear = function (node) {
            if (node[dataStoreKeyExpandoPropertyName]) {
                delete node[dataStoreKeyExpandoPropertyName];
                return true;
            }
            return false;
        };
    } else {
        getDataForNode = function (node, createIfNotFound) {
            var dataStoreKey = node[dataStoreKeyExpandoPropertyName];
            var hasExistingDataStore = dataStoreKey && (dataStoreKey !== "null") && dataStore[dataStoreKey];
            if (!hasExistingDataStore) {
                if (!createIfNotFound)
                    return undefined;
                dataStoreKey = node[dataStoreKeyExpandoPropertyName] = "ko" + uniqueId++;
                dataStore[dataStoreKey] = {};
            }
            return dataStore[dataStoreKey];
        };
        clear = function (node) {
            var dataStoreKey = node[dataStoreKeyExpandoPropertyName];
            if (dataStoreKey) {
                delete dataStore[dataStoreKey];
                node[dataStoreKeyExpandoPropertyName] = null;
                return true; // Exposing "did clean" flag purely so specs can infer whether things have been cleaned up as intended
            }
            return false;
        };
    }

    return {
        get: function (node, key) {
            var dataForNode = getDataForNode(node, false);
            return dataForNode && dataForNode[key];
        },
        set: function (node, key, value) {
            // Make sure we don't actually create a new domData key if we are actually deleting a value
            var dataForNode = getDataForNode(node, value !== undefined /* createIfNotFound */);
            dataForNode && (dataForNode[key] = value);
        },
        clear: clear,

        nextKey: function () {
            return (uniqueId++) + dataStoreKeyExpandoPropertyName;
        }
    };
})();

ko.exportSymbol('utils.domData', ko.utils.domData);
ko.exportSymbol('utils.domData.clear', ko.utils.domData.clear); // Exporting only so specs can clear up after themselves fully

@@ -212,24 +212,271 @@
 eVersion) %7B%0A
+        // We considered using WeakMap, but it has a problem in IE 11 and Edge that prevents using%0A        // it cross-window, so instead we just store the data directly on the node.%0A        // See https://github.com/knockout/knockout/issues/2141%0A
         getD
@@ -961,72 +961,349 @@
 rue;
-%0A            %7D%0A            return false;%0A        %7D;%0A    %7D else %7B
+ // Exposing %22did clean%22 flag purely so specs can infer whether things have been cleaned up as intended%0A            %7D%0A            return false;%0A        %7D;%0A    %7D else %7B%0A        // Old IE versions have memory issues if you store objects on the node, so we use a%0A        // separate data storage and link to it from the node using a string key.
 %0A   

Add comments about domData choices.