[Pkg-mozext-commits] [firebug] 16/82: Issue 5873: Hack to make .% in breakpoint conditions work
David Prévot
taffit at moszumanska.debian.org
Mon Mar 31 22:45:36 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag fbtest-1.11.2
in repository firebug.
commit 43e7734e10c13eb44ae400df5b56d570f9989b73
Author: Simon Lindholm <simon.lindholm10 at gmail.com>
Date: Sat Nov 17 00:39:09 2012 +0100
Issue 5873: Hack to make .% in breakpoint conditions work
---
.../content/firebug/console/closureInspector.js | 1 +
extension/content/firebug/js/debugger.js | 5 ++++
extension/modules/firebug-service.js | 29 +++++++++++++++++++++-
3 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/extension/content/firebug/console/closureInspector.js b/extension/content/firebug/console/closureInspector.js
index 7e5870c..af04315 100644
--- a/extension/content/firebug/console/closureInspector.js
+++ b/extension/content/firebug/console/closureInspector.js
@@ -386,6 +386,7 @@ var ClosureInspector =
}
};
+Firebug.ClosureInspector = ClosureInspector;
return ClosureInspector;
// ********************************************************************************************* //
diff --git a/extension/content/firebug/js/debugger.js b/extension/content/firebug/js/debugger.js
index 810c673..21368e1 100644
--- a/extension/content/firebug/js/debugger.js
+++ b/extension/content/firebug/js/debugger.js
@@ -122,6 +122,11 @@ Firebug.Debugger = Obj.extend(Firebug.ActivableModule,
});
},
+ _temporaryTransformSyntax: function(expr, win, context)
+ {
+ return Firebug.ClosureInspector.extendLanguageSyntax(expr, win, context);
+ },
+
/**
* Used by autocomplete in commandLine
* @return array of locally visible property names for each scope we are in
diff --git a/extension/modules/firebug-service.js b/extension/modules/firebug-service.js
index d67eeab..84b9215 100644
--- a/extension/modules/firebug-service.js
+++ b/extension/modules/firebug-service.js
@@ -1231,6 +1231,7 @@ var fbs =
}
bp.condition = condition;
+ delete bp.transformedCondition;
dispatch(debuggers, "onToggleBreakpoint", [sourceFile.href, lineNo, true, bp]);
@@ -3294,6 +3295,7 @@ var fbs =
if (props)
{
bp.condition = props.condition;
+ delete bp.transformedCondition;
bp.onTrue = props.onTrue;
bp.hitCount = props.hitCount;
if (bp.condition || bp.hitCount > 0)
@@ -4349,7 +4351,32 @@ function testBreakpoint(frame, bp)
var result = {};
frame.scope.refresh();
- if (frame.eval(bp.condition, "", 1, result))
+ // ugly hack for closure getter syntax
+ // (see also transformedCondition elsewhere in the code)
+ var cond = bp.condition;
+ if (cond.indexOf(".%") !== -1)
+ {
+ var frameScopeRoot = fbs.getOutermostScope(frame);
+ if (frameScopeRoot)
+ {
+ if (bp.transformedCondition && "__fb_scopedVars" in frameScopeRoot.wrappedJSObject)
+ {
+ // Fast path: everything is already prepared for us.
+ cond = bp.transformedCondition;
+ }
+ else
+ {
+ var debuggr = fbs.findDebugger(frame);
+ var context = debuggr.breakContext;
+ delete debuggr.breakContext;
+
+ cond = debuggr._temporaryTransformSyntax(cond, frameScopeRoot, context);
+ bp.transformedCondition = cond;
+ }
+ }
+ }
+
+ if (frame.eval(cond, "", 1, result))
{
if (bp.onTrue)
{
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git
More information about the Pkg-mozext-commits
mailing list