/js/src/jit-test/tests/debug/Object-name-02.js

http://github.com/zpao/v8monkey · JavaScript · 16 lines · 13 code · 2 blank · 1 comment · 0 complexity · bcca5e537449299adeea48a487606a48 MD5 · raw file

  1. // The .name of a non-function object is undefined.
  2. var g = newGlobal('new-compartment');
  3. var hits = 0;
  4. var dbg = new Debugger(g);
  5. dbg.onDebuggerStatement = function (frame) {
  6. assertEq(frame.arguments[0].name, undefined);
  7. hits++;
  8. };
  9. g.eval("function f(nonfunction) { debugger; }");
  10. g.eval("f({});");
  11. g.eval("f(/a*/);");
  12. g.eval("f({name: 'bad'});");
  13. g.eval("f(Proxy.createFunction({name: {value: 'bad'}}, function () {}));");
  14. assertEq(hits, 4);