From dbaa6850aa03f28945f957576aeb6f6f8e57fa64 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Tue, 23 Jul 2019 11:19:25 -0500 Subject: [PATCH] allow omission of attributes if attributeOldValue or attributeFilter is specified --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 66cdc6f..e4496ea 100644 --- a/index.js +++ b/index.js @@ -190,6 +190,11 @@ JsMutationObserver.prototype = { observe: function(target, options) { target = wrapIfNeeded(target); + var needsAttributes = options.hasOwnProperty('attributeOldValue') || options.hasOwnProperty('attributeFilter'); + if (needsAttributes && !options.hasOwnProperty('attributes')) { + options.attributes = true; + } + // 1.1 if (!options.childList && !options.attributes && !options.characterData ||