/js/src/jit-test/tests/debug/surfaces-01.js

http://github.com/zpao/v8monkey · JavaScript · 17 lines · 13 code · 3 blank · 1 comment · 0 complexity · 36ba4149a7c11922ade114e4bd6fee6d MD5 · raw file

  1. // Check superficial characteristics of functions and properties (not functionality).
  2. function checkFunction(obj, name, nargs) {
  3. var desc = Object.getOwnPropertyDescriptor(obj, name);
  4. assertEq(desc.configurable, true, name + " should be configurable");
  5. assertEq(desc.writable, true, name + " should be writable");
  6. assertEq(desc.enumerable, false, name + " should be non-enumerable");
  7. assertEq(desc.value, obj[name]); // well obviously
  8. assertEq(typeof desc.value, 'function', name + " should be a function");
  9. assertEq(desc.value.length, nargs, name + " should have .length === " + nargs);
  10. }
  11. checkFunction(this, "Debugger", 1);
  12. assertEq(Debugger.prototype.constructor, Debugger);
  13. assertEq(Object.prototype.toString.call(Debugger.prototype), "[object Debugger]");
  14. assertEq(Object.getPrototypeOf(Debugger.prototype), Object.prototype);