This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose the V8 debug object process.debug
Add one duplicate test from V8, just to make sure it works.
- Loading branch information
Showing
4 changed files
with
44 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
common = require("../common"); | ||
assert = require("assert"); | ||
|
||
|
||
// This is a duplicate of deps/v8/test/mjsunit/debug-liveedit-1.js | ||
// Just exercises the process.debug object. | ||
|
||
eval("var something1 = 25; " | ||
+ " function ChooseAnimal() { return 'Cat'; } " | ||
+ " ChooseAnimal.Helper = function() { return 'Help!'; }"); | ||
|
||
assert.equal("Cat", ChooseAnimal()); | ||
|
||
var script = process.debug.findScript(ChooseAnimal); | ||
|
||
var orig_animal = "Cat"; | ||
var patch_pos = script.source.indexOf(orig_animal); | ||
var new_animal_patch = "Cap' + 'y' + 'bara"; | ||
|
||
var change_log = new Array(); | ||
process.debug.LiveEdit.TestApi.ApplySingleChunkPatch(script, | ||
patch_pos, | ||
orig_animal.length, | ||
new_animal_patch, | ||
change_log); | ||
|
||
assert.equal("Capybara", ChooseAnimal()); |