Created
July 22, 2013 17:36
-
-
Save disnet/6055864 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro forThing { | |
case $val ($a:expr, $b:expr) => {(function($val){forEach.call($b, this)}).bind($a)} | |
case $val ($a:expr) => {(function($val){forEach.call(val,this)}).bind($a)} | |
} | |
function makeMutationObserver(tag){ | |
var queue= tag.queue, | |
put= queue.put.bind(queue), | |
mutationAddObserve= forThing val (put, val.getElementsByTagName(this.tag)), | |
mutationObserver= forThing val (mutationAddObserve, val.addedNodes), | |
mutationsObserver= forThing val (mutationObserver) | |
return new MutationObserver(mutationsObserver) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment