From 052d63f5bdcbfdcbb5adf66c1019dd47e464ae4a Mon Sep 17 00:00:00 2001 From: "yurys@chromium.org" Date: Tue, 12 May 2009 09:08:01 +0000 Subject: [PATCH] Script context information is included in before/afterCompile events. Review URL: http://codereview.chromium.org/115128 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1911 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/debug-delay.js | 3 ++- test/mjsunit/debug-compile-event.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/debug-delay.js b/src/debug-delay.js index ff7d6fb..865b2ba 100644 --- a/src/debug-delay.js +++ b/src/debug-delay.js @@ -984,7 +984,8 @@ CompileEvent.prototype.toJSONProtocol = function() { o.event = "afterCompile"; } o.body = {}; - o.body.script = MakeScriptObject_(this.script_, true); + o.body.script = this.script_; + o.setOption('includeSource', true); return o.toJSONProtocol(); } diff --git a/test/mjsunit/debug-compile-event.js b/test/mjsunit/debug-compile-event.js index 035e36c..18975de 100644 --- a/test/mjsunit/debug-compile-event.js +++ b/test/mjsunit/debug-compile-event.js @@ -65,6 +65,10 @@ function listener(event, exec_state, event_data, data) { // exact source. assertEquals(current_source, event_data.script().source()); } + // Check that script context is included into the event message. + var json = event_data.toJSONProtocol(); + var msg = eval('(' + json + ')'); + assertTrue('context' in msg.body.script); } } catch (e) { exception = e -- 2.7.4