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

Unified Diff: test/mjsunit/regress/regress-1586.js

Issue 7607031: Update gc branch to bleeding_edge revision 8862. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Fix bug in weak-map merge Created 9 years, 4 months 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/regress/regress-1583.js ('k') | test/mjsunit/regress/regress-91008.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-1586.js
diff --git a/src/shell.h b/test/mjsunit/regress/regress-1586.js
similarity index 61%
copy from src/shell.h
copy to test/mjsunit/regress/regress-1586.js
index ca510408cccde4a8cfe31e7f5bcfd15798695622..b15e2f2432d7ae9b844749201228a25d4049889f 100644
--- a/src/shell.h
+++ b/test/mjsunit/regress/regress-1586.js
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -24,32 +24,41 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// A simple interactive shell. Enable with --shell.
-
-#ifndef V8_SHELL_H_
-#define V8_SHELL_H_
-#include "../public/debug.h"
+// Flags: --expose-debug-as debug
-namespace v8 {
-namespace internal {
+// Test debug evaluation for functions without local context, but with
+// nested catch contexts.
-// Debug event handler for interactive debugging.
-void handle_debug_event(v8::DebugEvent event,
- v8::Handle<v8::Object> exec_state,
- v8::Handle<v8::Object> event_data,
- v8::Handle<Value> data);
+function f() {
+ var i = 1; // Line 1.
+ { // Line 2.
+ try { // Line 3.
+ throw 'stuff'; // Line 4.
+ } catch (e) { // Line 5.
+ x = 2; // Line 6.
+ }
+ }
+};
+// Get the Debug object exposed from the debug context global object.
+Debug = debug.Debug
+// Set breakpoint on line 6.
+var bp = Debug.setBreakPoint(f, 6);
-class Shell {
- public:
- static void PrintObject(v8::Handle<v8::Value> obj);
- // Run the read-eval loop, executing code in the specified
- // environment.
- static void Run(v8::Handle<v8::Context> context);
+function listener(event, exec_state, event_data, data) {
+ if (event == Debug.DebugEvent.Break) {
+ result = exec_state.frame().evaluate("i").value();
+ }
};
-} } // namespace v8::internal
+// Add the debug event listener.
+Debug.setListener(listener);
+result = -1;
+f();
+assertEquals(1, result);
-#endif // V8_SHELL_H_
+// Clear breakpoint.
+Debug.clearBreakPoint(bp);
+// Get rid of the debug event listener.
+Debug.setListener(null);
« no previous file with comments | « test/mjsunit/regress/regress-1583.js ('k') | test/mjsunit/regress/regress-91008.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698