From 989749f4d3ed9f21dfe376bb93e4bc2fef32cfbe Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Tue, 1 Apr 2014 17:51:08 -0700 Subject: [PATCH] fix: broken code after refactor --- content-scripts/inject.js | 2 +- content-scripts/lib/niceNames.js | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/content-scripts/inject.js b/content-scripts/inject.js index 69d57fe..7154d04 100644 --- a/content-scripts/inject.js +++ b/content-scripts/inject.js @@ -123,7 +123,7 @@ var instument = function instument (window) { deps: [] }; - var instrumentedAppId = window.location.host + '~' + Date.now() + '~' Math.random(); + var instrumentedAppId = window.location.host + '~' + Date.now() + '~' + Math.random(); // Utils diff --git a/content-scripts/lib/niceNames.js b/content-scripts/lib/niceNames.js index 99186dd..f7875be 100644 --- a/content-scripts/lib/niceNames.js +++ b/content-scripts/lib/niceNames.js @@ -21,19 +21,17 @@ var interestingAttributes = { // body... }, 'ng-repeat': function (value) { - match = /(.+) in/.exec(val); - lhs = match[1]; + match = /(.+) in/.exec(val); + lhs = match[1]; - match = lhs.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/); - valueIdentifier = match[3] || match[1]; - keyIdentifier = match[2]; - - if (keyIdentifier) { - name.lhs = valueIdentifier + '["' + scope[keyIdentifier] + '"]' + summarizeObject(scope[valueIdentifier]); - } else { - name.lhs = valueIdentifier + summarizeObject(scope[valueIdentifier]); - } + match = lhs.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/); + valueIdentifier = match[3] || match[1]; + keyIdentifier = match[2]; + if (keyIdentifier) { + name.lhs = valueIdentifier + '["' + scope[keyIdentifier] + '"]' + summarizeObject(scope[valueIdentifier]); + } else { + name.lhs = valueIdentifier + summarizeObject(scope[valueIdentifier]); } } }