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); |