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

Unified Diff: test/mjsunit/debug-liveedit-4.js

Issue 23783007: LiveEdit to mark more closure functions for re-instantiation when scope layout changes (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase Created 7 years, 3 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 | « 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-4.js
diff --git a/test/mjsunit/debug-liveedit-3.js b/test/mjsunit/debug-liveedit-4.js
similarity index 81%
copy from test/mjsunit/debug-liveedit-3.js
copy to test/mjsunit/debug-liveedit-4.js
index b2106579d839bcf9964759e78430dd94393d0723..38f751440a771bb488c3d9c8632afa7d816fea62 100644
--- a/test/mjsunit/debug-liveedit-3.js
+++ b/test/mjsunit/debug-liveedit-4.js
@@ -35,36 +35,35 @@
Debug = debug.Debug
-var function_z_text =
-" function Z() {\n"
-+ " return 2 + p;\n"
-+ " }\n";
-
eval(
-"function Factory(p) {\n"
-+ "return (\n"
-+ function_z_text
-+ ");\n"
+"function TestFunction() {\n"
++ " var a = 'a';\n"
++ " var b = 'b';\n"
++ " var c = 'c';\n"
++ " function A() {\n"
++ " return 2013;\n"
++ " }\n"
++ " function B() {\n"
++ " return String([a, c]);\n"
++ " }\n"
++ " return B();\n"
+ "}\n"
);
-var z6 = Factory(6);
-assertEquals(8, z6());
-
-var script = Debug.findScript(Factory);
+var res = TestFunction();
+print(res);
+assertEquals('a,c', res);
-var new_source = script.source.replace(function_z_text, "function Intermediate() {\nreturn (\n" + function_z_text + ")\n;\n}\n");
+var script = Debug.findScript(TestFunction);
+var new_source = script.source.replace("2013", "b");
print("new source: " + new_source);
-
var change_log = new Array();
var result = Debug.LiveEdit.SetScriptSource(script, new_source, false, change_log);
+
print("Result: " + JSON.stringify(result) + "\n");
print("Change log: " + JSON.stringify(change_log) + "\n");
-assertEquals(8, z6());
-
-var z100 = Factory(100)();
-
-assertEquals(102, z100());
-
-
+var res = TestFunction();
+print(res);
+// This might be 'a,b' without a bug fixed.
+assertEquals('a,c', res);
« no previous file with comments | « src/liveedit-debugger.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698