Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: test/mjsunit/debug-compile-event.js

Issue 781623004: [V8] Report v8::AfterCompile and v8::CompileError to listener on pause (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed tests Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/debug-clearbreakpointgroup.js ('k') | test/mjsunit/debug-evaluate-with-context.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/debug-compile-event.js
diff --git a/test/mjsunit/debug-compile-event.js b/test/mjsunit/debug-compile-event.js
index c38cd8477a9fe4d53b110f419d7b099292a111ff..862340602b34c6b145d872bdc64efa643d1592e1 100644
--- a/test/mjsunit/debug-compile-event.js
+++ b/test/mjsunit/debug-compile-event.js
@@ -37,7 +37,7 @@ var current_source = ''; // Current source being compiled.
var source_count = 0; // Total number of scources compiled.
var host_compilations = 0; // Number of scources compiled through the API.
var eval_compilations = 0; // Number of scources compiled through eval.
-
+var mute_listener = false;
function compileSource(source) {
current_source = source;
@@ -45,8 +45,20 @@ function compileSource(source) {
source_count++;
}
+function safeEval(code) {
+ try {
+ mute_listener = true;
+ return eval('(' + code + ')');
+ } catch (e) {
+ assertEquals(void 0, e);
+ return undefined;
+ } finally {
+ mute_listener = false;
+ }
+}
function listener(event, exec_state, event_data, data) {
+ if (mute_listener) return;
try {
if (event == Debug.DebugEvent.BeforeCompile ||
event == Debug.DebugEvent.AfterCompile ||
@@ -81,7 +93,7 @@ function listener(event, exec_state, event_data, data) {
}
// Check that script context is included into the event message.
var json = event_data.toJSONProtocol();
- var msg = eval('(' + json + ')');
+ var msg = safeEval(json);
assertTrue('context' in msg.body.script);
// Check that we pick script name from //# sourceURL, iff present
« no previous file with comments | « test/mjsunit/debug-clearbreakpointgroup.js ('k') | test/mjsunit/debug-evaluate-with-context.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698