Skip to content

Commit 59d32f9

Browse files
committed
Remove old, commented out code
1 parent 8186d13 commit 59d32f9

File tree

2 files changed

+0
-103
lines changed

2 files changed

+0
-103
lines changed

can-dom-mutate.js

Lines changed: 0 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,6 @@ function deleteRelatedData(node, key) {
5151
function toMutationEvent(node, mutation) {
5252
return {target: node, sourceMutation: mutation};
5353
}
54-
/*
55-
function toMutationEvents (nodes) {
56-
var events = [];
57-
for (var i = 0, length = nodes.length; i < length; i++) {
58-
events.push({target: nodes[i]});
59-
}
60-
return events;
61-
}
62-
*/
6354

6455
function getDocumentListeners (target, key) {
6556
// TODO: it's odd these functions read DOCUMENT() instead of
@@ -130,41 +121,15 @@ function flushCallbacks(callbacks, arg){
130121
safeCallbacks[c](arg);
131122
}
132123
}
133-
/*
134-
function flushRecords(){
135-
if(recordsAndCallbacks === null) {
136-
return;
137-
}
138-
var safeBatch = recordsAndCallbacks;
139-
recordsAndCallbacks = null;
140-
141-
var batchCount = safeBatch.length;
142-
143-
for (var i = 0; i < batchCount; i++) {
144-
var batchData = safeBatch[i];
145-
flushCallbacks(batchData.callbacks, batchData.arg);
146-
}
147-
}
148124

149-
function flushAsync(callbacks, arg) {
150-
if(recordsAndCallbacks === null) {
151-
recordsAndCallbacks = [{arg: arg, callbacks: callbacks}];
152-
nextTick(flushRecords);
153-
} else {
154-
recordsAndCallbacks.push({arg: arg, callbacks: callbacks});
155-
}
156-
}
157-
*/
158125
function dispatch(getListeners, targetKey) {
159126

160127
return function dispatchEvents(event) {
161-
162128
var targetListeners = getListeners(event.target, targetKey);
163129

164130
if (targetListeners) {
165131
flushCallbacks(targetListeners, event);
166132
}
167-
168133
};
169134
}
170135

@@ -220,68 +185,6 @@ function observeMutations(target, observerKey, config, handler) {
220185
}
221186
};
222187
}
223-
/*
224-
function handleTreeMutations(mutations) {
225-
// in IE11, if the document is being removed
226-
// (such as when an iframe is added and then removed)
227-
// all of the global constructors will not exist
228-
// If this happens before a tree mutation is handled,
229-
// this will throw an `Object expected` error.
230-
if (typeof Set === "undefined") { return; }
231-
232-
if(this.flushing === true) {
233-
this.mutations.push.apply(this.mutations, mutations);
234-
return;
235-
}
236-
this.flushing = true;
237-
this.mutations = [].slice.call(mutations);
238-
239-
var mutation;
240-
241-
var mutationCount = mutations.length;
242-
var added = new Set(), removed = new Set();
243-
244-
while(mutation = this.mutations.shift()) {
245-
var removedCount = mutation.removedNodes.length;
246-
for (var r = 0; r < removedCount; r++) {
247-
// get what already isn't in `removed`
248-
var newRemoved = util.addToSet( getAllNodes(mutation.removedNodes[r]), removed);
249-
dispatchRemoval( newRemoved.map(toMutationEvent), null, true, flushCallbacks );
250-
}
251-
252-
var addedCount = mutation.addedNodes.length;
253-
for (var a = 0; a < addedCount; a++) {
254-
var newAdded = util.addToSet( getAllNodes(mutation.addedNodes[a]), added);
255-
dispatchInsertion( newAdded.map(toMutationEvent), null, true, flushCallbacks );
256-
}
257-
258-
}
259-
260-
this.flushing = false;
261-
//dispatchRemoval( toMutationEvents( canReflect.toArray(removed) ), null, true, flushCallbacks );
262-
//dispatchInsertion( toMutationEvents( canReflect.toArray(added) ), null, true, flushCallbacks );
263-
}
264-
265-
function handleAttributeMutations(mutations) {
266-
var mutationCount = mutations.length;
267-
for (var m = 0; m < mutationCount; m++) {
268-
var mutation = mutations[m];
269-
if (mutation.type === 'attributes') {
270-
var node = mutation.target;
271-
var attributeName = mutation.attributeName;
272-
var oldValue = mutation.oldValue;
273-
dispatchAttributeChange([{
274-
target: node,
275-
attributeName: attributeName,
276-
oldValue: oldValue
277-
}], null, true, flushCallbacks);
278-
}
279-
}
280-
}
281-
*/
282-
283-
284-
285188

286189
var treeMutationConfig = {
287190
subtree: true,
@@ -459,10 +362,6 @@ function dispatchTreeMutation(mutation, processedState) {
459362
}
460363

461364

462-
463-
464-
465-
466365
var FLUSHING_MUTATIONS = [];
467366
var IS_FLUSHING = false;
468367

node/node.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,4 @@ var mutationObserverKey = 'MutationObserver';
179179
setMutateStrategy(globals.getKeyValue(mutationObserverKey));
180180
globals.onKeyValue(mutationObserverKey, setMutateStrategy);
181181

182-
//mutate.isConnected = isConnected;
183-
184182
module.exports = namespace.domMutateNode = domMutate.node = mutate;

0 commit comments

Comments
 (0)