Could you please add more tests that exercise different combinations of stack allocated and context allocated variables? And also tests with "let" variables
(this requires --harmony flag and "use strict").

For example, the following script outputs
0: {"visible2":20}
1: {"visible1":10}

because all other variables are stack allocated. Would Dev-tools work correctly
in such cases?

===========
var Debug = debug.Debug;

var f = (function F1(invisible_parameter) {
  var invisible1 = 1;
  var visible1 = 10;
  return (function F2() {
    var invisible2 = 2;
    return (function F3() {
      var visible2 = 20;
      var invisible2 = 3;
      return (function () {return visible1 + visible2;});
    })();
  })();
})(5);

var mirror = Debug.MakeMirror(f);
var count = mirror.scopeCount() - 1;
for (var i = 0; i < count; i++) {
  print(i + ": " + JSON.stringify(mirror.scope(i).scopeObject().value()))
}
===========


https://chromiumcodereview.appspot.com/10171003/diff/16001/src/runtime.cc
File src/runtime.cc (right):

https://chromiumcodereview.appspot.com/10171003/diff/16001/src/runtime.cc#newcode11420
src/runtime.cc:11420: for (ScopeIterator it(isolate, fun);
This fits in one line.

https://chromiumcodereview.appspot.com/10171003/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to