From a40edfb2e8953a116d4ce9b7c844b428551917fd Mon Sep 17 00:00:00 2001 From: taoqf Date: Mon, 16 Jul 2018 16:41:03 +0800 Subject: [PATCH] replace const with var --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 7287e97..34f6198 100644 --- a/src/index.ts +++ b/src/index.ts @@ -497,7 +497,7 @@ export class Matcher { method = '=='; } const value = matcher[7] || matcher[8]; - source += `const attrs = el.attributes;for (const key in attrs){const val = attrs[key]; if (key == "${attr_key}" && val ${method} "${value}"){return true;}} return false;`; + source += `var attrs = el.attributes;for (var key in attrs){const val = attrs[key]; if (key == "${attr_key}" && val ${method} "${value}"){return true;}} return false;`; } else { source += 'if (el.tagName != ' + JSON.stringify(tagName) + ') return false;'; }