@@ -7,7 +7,7 @@ const LEAF_SUBTYPES = new Set(['date', 'regexp'])
77const ITERABLE_SUBTYPES = new Set ( [ 'map' , 'set' , 'weakmap' , 'weakset' ] )
88
99module . exports = {
10- getRuntimeObject : getObject
10+ collectObjectProperties
1111}
1212
1313/**
@@ -21,7 +21,7 @@ module.exports = {
2121 */
2222
2323/**
24- * Get the properties of an object using the Chrome DevTools Protocol.
24+ * Collect the properties of an object using the Chrome DevTools Protocol.
2525 *
2626 * @param {string } objectId - The ID of the object to get the properties of
2727 * @param {GetObjectOptions } opts - The options for the snapshot. Also used to track the deadline and communicate the
@@ -32,7 +32,7 @@ module.exports = {
3232 * track the current object type and should not be set by the caller.
3333 * @returns {Promise<Object[]> } The properties of the object
3434 */
35- async function getObject ( objectId , opts , depth = 0 , collection = false ) {
35+ async function collectObjectProperties ( objectId , opts , depth = 0 , collection = false ) {
3636 const { result, privateProperties } = await session . post ( 'Runtime.getProperties' , {
3737 objectId,
3838 ownProperties : true // exclude inherited properties
@@ -75,7 +75,7 @@ async function traverseGetPropertiesResult (props, opts, depth) {
7575 if ( LEAF_SUBTYPES . has ( subtype ) ) continue // don't waste time with these subtypes
7676 work . push ( [
7777 prop . value ,
78- ( ) => getObjectProperties ( subtype , objectId , opts , depth ) . then ( ( properties ) => {
78+ ( ) => collectPropertiesBySubtype ( subtype , objectId , opts , depth ) . then ( ( properties ) => {
7979 prop . value . properties = properties
8080 } )
8181 ] )
@@ -112,7 +112,7 @@ async function traverseGetPropertiesResult (props, opts, depth) {
112112 return props
113113}
114114
115- function getObjectProperties ( subtype , objectId , opts , depth ) {
115+ function collectPropertiesBySubtype ( subtype , objectId , opts , depth ) {
116116 if ( ITERABLE_SUBTYPES . has ( subtype ) ) {
117117 return getIterable ( objectId , opts , depth )
118118 } else if ( subtype === 'promise' ) {
@@ -122,7 +122,7 @@ function getObjectProperties (subtype, objectId, opts, depth) {
122122 } else if ( subtype === 'arraybuffer' ) {
123123 return getArrayBuffer ( objectId , opts , depth )
124124 }
125- return getObject ( objectId , opts , depth + 1 , subtype === 'array' || subtype === 'typedarray' )
125+ return collectObjectProperties ( objectId , opts , depth + 1 , subtype === 'array' || subtype === 'typedarray' )
126126}
127127
128128// TODO: The following extra information from `internalProperties` might be relevant to include for functions:
0 commit comments