@@ -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/**
@@ -22,7 +22,7 @@ module.exports = {
2222 */
2323
2424/**
25- * Get the properties of an object using the Chrome DevTools Protocol.
25+ * Collect the properties of an object using the Chrome DevTools Protocol.
2626 *
2727 * @param {string } objectId - The ID of the object to get the properties of
2828 * @param {GetObjectOptions } opts - The options for the snapshot. Also used to track the deadline and communicate the
@@ -33,7 +33,7 @@ module.exports = {
3333 * track the current object type and should not be set by the caller.
3434 * @returns {Promise<Object[]> } The properties of the object
3535 */
36- async function getObject ( objectId , opts , depth = 0 , collection = false ) {
36+ async function collectObjectProperties ( objectId , opts , depth = 0 , collection = false ) {
3737 const { result, privateProperties } = await session . post ( 'Runtime.getProperties' , {
3838 objectId,
3939 ownProperties : true // exclude inherited properties
@@ -76,7 +76,7 @@ async function traverseGetPropertiesResult (props, opts, depth) {
7676 if ( LEAF_SUBTYPES . has ( subtype ) ) continue // don't waste time with these subtypes
7777 work . push ( [
7878 prop . value ,
79- ( ) => getObjectProperties ( subtype , objectId , opts , depth ) . then ( ( properties ) => {
79+ ( ) => collectPropertiesBySubtype ( subtype , objectId , opts , depth ) . then ( ( properties ) => {
8080 prop . value . properties = properties
8181 } )
8282 ] )
@@ -113,7 +113,7 @@ async function traverseGetPropertiesResult (props, opts, depth) {
113113 return props
114114}
115115
116- function getObjectProperties ( subtype , objectId , opts , depth ) {
116+ function collectPropertiesBySubtype ( subtype , objectId , opts , depth ) {
117117 if ( ITERABLE_SUBTYPES . has ( subtype ) ) {
118118 return getIterable ( objectId , opts , depth )
119119 } else if ( subtype === 'promise' ) {
@@ -123,7 +123,7 @@ function getObjectProperties (subtype, objectId, opts, depth) {
123123 } else if ( subtype === 'arraybuffer' ) {
124124 return getArrayBuffer ( objectId , opts , depth )
125125 }
126- return getObject ( objectId , opts , depth + 1 , subtype === 'array' || subtype === 'typedarray' )
126+ return collectObjectProperties ( objectId , opts , depth + 1 , subtype === 'array' || subtype === 'typedarray' )
127127}
128128
129129// TODO: The following extra information from `internalProperties` might be relevant to include for functions:
0 commit comments