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

Unified Diff: test/mjsunit/debug-liveedit-compile-error.js

Issue 11421100: Issue 2429, core implementation and the protocol change (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: follow codereview Created 8 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
« src/liveedit.cc ('K') | « src/liveedit-debugger.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/debug-liveedit-compile-error.js
diff --git a/test/mjsunit/debug-liveedit-1.js b/test/mjsunit/debug-liveedit-compile-error.js
similarity index 76%
copy from test/mjsunit/debug-liveedit-1.js
copy to test/mjsunit/debug-liveedit-compile-error.js
index 1ee7ce2a7cb19ee685ffd714db8ddc9b68d4519f..2fd6aedabf25abb9a1afda4db700fdf4061668aa 100644
--- a/test/mjsunit/debug-liveedit-1.js
+++ b/test/mjsunit/debug-liveedit-compile-error.js
@@ -1,4 +1,4 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
+// Copyright 2012 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:
@@ -30,9 +30,9 @@
Debug = debug.Debug
-eval("var something1 = 25; "
- + " function ChooseAnimal() { return 'Cat'; } "
- + " ChooseAnimal.Helper = function() { return 'Help!'; }");
+eval("var something1 = 25; \n"
+ + " function ChooseAnimal() { return 'Cat'; } \n"
+ + " ChooseAnimal.Helper = function() { return 'Help!'; }\n");
assertEquals("Cat", ChooseAnimal());
@@ -40,9 +40,21 @@ var script = Debug.findScript(ChooseAnimal);
var orig_animal = "Cat";
var patch_pos = script.source.indexOf(orig_animal);
-var new_animal_patch = "Cap' + 'y' + 'bara";
+var new_animal_patch = "Cap' + ) + 'bara";
var change_log = new Array();
-Debug.LiveEdit.TestApi.ApplySingleChunkPatch(script, patch_pos, orig_animal.length, new_animal_patch, change_log);
+var caught_exception = null;
+try {
+ Debug.LiveEdit.TestApi.ApplySingleChunkPatch(script, patch_pos,
+ orig_animal.length, new_animal_patch, change_log);
+} catch (e) {
+ caught_exception = e;
+}
+
+assertNotNull(caught_exception);
+assertEquals("Unexpected token )",
+ caught_exception.details.syntaxErrorMessage);
+
+assertEquals(2, caught_exception.details.position.start.line);
+
-assertEquals("Capybara", ChooseAnimal());
« src/liveedit.cc ('K') | « src/liveedit-debugger.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698