/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
- // Check superficial characteristics of functions and properties (not functionality).
- function checkFunction(obj, name, nargs) {
- var desc = Object.getOwnPropertyDescriptor(obj, name);
- assertEq(desc.configurable, true, name + " should be configurable");
- assertEq(desc.writable, true, name + " should be writable");
- assertEq(desc.enumerable, false, name + " should be non-enumerable");
- assertEq(desc.value, obj[name]); // well obviously
- assertEq(typeof desc.value, 'function', name + " should be a function");
- assertEq(desc.value.length, nargs, name + " should have .length === " + nargs);
- }
- checkFunction(this, "Debugger", 1);
- assertEq(Debugger.prototype.constructor, Debugger);
- assertEq(Object.prototype.toString.call(Debugger.prototype), "[object Debugger]");
- assertEq(Object.getPrototypeOf(Debugger.prototype), Object.prototype);