Index: test/debugger/debug/es6/debug-liveedit-new-target-2.js |
diff --git a/test/debugger/debug/es6/debug-liveedit-new-target-2.js b/test/debugger/debug/es6/debug-liveedit-new-target-2.js |
index e87e8b574ece7b911c5a9d10de35582042e1f2ff..764c57c54eb991e9713e310057f7c69991059a0a 100644 |
--- a/test/debugger/debug/es6/debug-liveedit-new-target-2.js |
+++ b/test/debugger/debug/es6/debug-liveedit-new-target-2.js |
@@ -19,8 +19,27 @@ eval(` |
} |
`); |
+function ExecuteInDebugContext(f) { |
+ var result; |
+ var exception = null; |
+ Debug.setListener(function(event) { |
+ if (event == Debug.DebugEvent.Break) { |
+ try { |
+ result = f(); |
+ } catch (e) { |
+ // Rethrow this exception later. |
+ exception = e; |
+ } |
+ } |
+ }); |
+ debugger; |
+ Debug.setListener(null); |
+ if (exception !== null) throw exception; |
+ return result; |
+} |
+ |
function Replace(fun, original, patch) { |
- %ExecuteInDebugContext(function() { |
+ ExecuteInDebugContext(function() { |
var change_log = []; |
try { |
var script = Debug.findScript(fun); |