node --allow-natives-syntax test.js
var obj = {a: 1};
%DebugPrint(obj);
它将输出:
0x053bedbc1399 <Object map = 0x53b630d1d51>
但是在早期版本的v8中,它会打印有关对象的完整信息,例如:
0x337ab90027d9: [Map]
- type: JS_ARRAY_TYPE
- instance size: 32
- inobject properties: 0
- elements kind: PACKED_SMI_ELEMENTS
- unused property fields: 0
- enum length: invalid
- back pointer: 0x337a1f6822e1 <undefined>
- instance descriptors (own) #1: 0x337a3c307a69 <FixedArray[5]>
- layout descriptor: 0x0
- transitions #1: 0x337a3c307979 <TransitionArray[4]>Transition array #1:
0x337a1f684631 <Symbol: (elements_transition_symbol)>: (transition to HOLEY_SMI_ELEMENTS) -> 0x337ab9002889 <Map(HOLEY_SMI_ELEMENTS)>
- prototype: 0x337a3c307809 <JSArray[0]>
- constructor: 0x337a3c304f21 <JSFunction Array (sfi = 0x337a1f6a9cb1)>
- code cache: 0x337a1f682251 <FixedArray[0]>
- dependent code: 0x337a1f682251 <FixedArray[0]>
- construction counter: 0
答案 0 :(得分:3)
这是Release和Debug版本之间的区别,而不是版本之间的区别。在发布模式下,大多数调试打印的实现都被跳过(出于二进制大小的原因),因此您只会得到一行输出。在Debug版本中,您将获得完整的详细信息。最近没有改变。