0

所有这些属性是什么?它们是属性或方法还是什么?它们看起来像标签。super_、fail、equal(等于什么?)、deepequal,它们是什么意思?您如何访问这些属性|方法|无论它们叫​​什么?它们是特定于节点的吗?

// $ node #start the node repl 
// > assert //outputs the below
{ [Function: ok]
  AssertionError: 
   { [Function: AssertionError]
     super_: 
      { [Function: Error]
        captureStackTrace: [Function: captureStackTrace],
        stackTraceLimit: 10 } },
  fail: [Function: fail],
  ok: [Circular],
  equal: [Function: equal],
  notEqual: [Function: notEqual],
  deepEqual: [Function: deepEqual],
  notDeepEqual: [Function: notDeepEqual],
  strictEqual: [Function: strictEqual],
  notStrictEqual: [Function: notStrictEqual],
  throws: [Function],
  doesNotThrow: [Function],
  ifError: [Function] }
4

1 回答 1

1

它们是 Nodeassert模块的属性和方法:http ://nodejs.org/api/assert.html

于 2012-07-01T03:18:28.147 回答