Script context information is included in before/afterCompile events.
authoryurys@chromium.org <yurys@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 12 May 2009 09:08:01 +0000 (09:08 +0000)
committeryurys@chromium.org <yurys@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 12 May 2009 09:08:01 +0000 (09:08 +0000)
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
test/mjsunit/debug-compile-event.js

index ff7d6fb..865b2ba 100644 (file)
@@ -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();
 }
index 035e36c..18975de 100644 (file)
@@ -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