PageRenderTime 13ms CodeModel.GetById 1ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

/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
 3function checkFunction(obj, name, nargs) {
 4    var desc = Object.getOwnPropertyDescriptor(obj, name);
 5    assertEq(desc.configurable, true, name + " should be configurable");
 6    assertEq(desc.writable, true, name + " should be writable");
 7    assertEq(desc.enumerable, false, name + " should be non-enumerable");
 8    assertEq(desc.value, obj[name]);  // well obviously
 9    assertEq(typeof desc.value, 'function', name + " should be a function");
10    assertEq(desc.value.length, nargs, name + " should have .length === " + nargs);
11}
12
13checkFunction(this, "Debugger", 1);
14
15assertEq(Debugger.prototype.constructor, Debugger);
16assertEq(Object.prototype.toString.call(Debugger.prototype), "[object Debugger]");
17assertEq(Object.getPrototypeOf(Debugger.prototype), Object.prototype);